Skip to content

FIX: Show bulk removal of expired invites #33716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2025

Conversation

Lhcfl
Copy link
Contributor

@Lhcfl Lhcfl commented Jul 19, 2025

An existing codepath to bulk delete invites exists, but does not show up. This commit fixes it and also fixes the old code's bug.

Specifically,

  • destroy_all_expired endpoint only acts on the current_user which is absolutely counter-intuitive, when a person visits another person’s profile and is able to see the button, clicking it would delete their own invites and not those of the profile they are visiting.
  • In UserInvitedShowController the removedAll state is never set to the original state, which results in the link being displayed in the list when the new link expires, but the batch deletion cannot be displayed unless the page is refreshed. It is replaced by a toast.

Screenshots

image image

Comment on lines +13 to +20
sign_in(admin)
end

describe "expired invites" do
let(:user_invite_expired_page) { PageObjects::Pages::UserInvitedExpired.new }
it "correctly shows expired invites" do
user_invite_expired_page.visit(user)
expect(user_invite_expired_page.invites_list.size).to eq(invites_expired.size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻 👍🏻

@nattsw nattsw merged commit 826dda2 into discourse:main Jul 21, 2025
28 of 29 checks passed
@Lhcfl Lhcfl deleted the fix-show-bulk-remove-invite branch July 22, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants