Skip to content

fix(react): preserve file gallery filter during refresh - #1488

Open
PritamMishra065 wants to merge 1 commit into
RocketChat:developfrom
PritamMishra065:rocket-dev
Open

PritamMishra065 wants to merge 1 commit into
RocketChat:developfrom
PritamMishra065:rocket-dev

Conversation

@PritamMishra065

@PritamMishra065 PritamMishra065 commented Dec 4, 2026 •

Copy link
Copy Markdown

Preserve the File Gallery filter when new messages arrive

Acceptance Criteria fulfillment

  • Keep the selected file-type filter when a new message refreshes the gallery.
  • Ignore late responses from a previous filter so the file list stays in sync with the dropdown.
  • Add regression tests for message-triggered refreshes and out-of-order responses.

Fixes #1477

Video/Screenshots

image

PR Test Details

  • Both File Gallery regression tests passed. They fail on the original code and pass with this fix.
  • The full React suite still fails in src/index.test.js while loading
    react-syntax-highlighter. The same failure occurs on upstream develop.

Manual test

  1. Open a channel containing both an image and a PDF.
  2. Open Options → Files and confirm both files appear under All.
  3. Select Images and confirm the PDF disappears.
  4. Keep the sidebar open and send a plain-text message in the same channel.
  5. Confirm Images remains selected and the PDF stays hidden.
  6. Switch back to All and confirm both files appear.

Note: The PR will be ready for live testing at
https://rocketchat.github.io/EmbeddedChat/pulls/pr-1488 after approval.

@PritamMishra065

Copy link
Copy Markdown
Author

@Spiral-Memory @Aryan-Verma-999 please review this

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: File Gallery loses selected file-type filter when new messages arrive

1 participant