Skip to content

fix: Search results are not fetching all files when the search box is empty(WPB-20817)#21066

Merged
arjita-mitra merged 3 commits intodevfrom
bugfix/stale-search-result-drive-WPB-20817
Apr 22, 2026
Merged

fix: Search results are not fetching all files when the search box is empty(WPB-20817)#21066
arjita-mitra merged 3 commits intodevfrom
bugfix/stale-search-result-drive-WPB-20817

Conversation

@arjita-mitra
Copy link
Copy Markdown
Contributor

@arjita-mitra arjita-mitra commented Apr 20, 2026

BugWPB-20817 [Web] Search results are not fetching all files when the search box is empty

Summary

Fixes an intermittent race in Conversation Files search where clearing the input could still show partial/stale results.

  1. Added a request version gate so only the latest in-flight search can update state.
  2. Clearing search now invalidates older requests immediately.
  3. Prevented stale success/error responses from overwriting current file list state.
  4. Extracted version gate logic into a pure utility (requestVersionGate) with focused unit tests.
  5. Simplified tests by covering core concurrency behavior without heavy hook/store mocking.

Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Accessibility (required)

Standards Acknowledgement (required)


Screenshots or demo (if the user interface changed)

Notes for reviewers

  • Trade-offs:
  • Follow-ups (linked issues):
  • Linked PRs (e.g. web-packages):

@arjita-mitra arjita-mitra changed the title fix: Search results are not fetching all files when the search box is… fix: Search results are not fetching all files when the search box is empty(WPB-20817) Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 14
  • Failed: 0
  • Skipped: 0
  • 🔁 Flaky: 0
  • 📊 Total: 14
  • Total Runtime: 191.7s (~ 3 min 12 sec)

screendriver
screendriver previously approved these changes Apr 22, 2026
@arjita-mitra arjita-mitra force-pushed the bugfix/stale-search-result-drive-WPB-20817 branch from f9984e7 to da2cf09 Compare April 22, 2026 07:05
@sonarqubecloud
Copy link
Copy Markdown

@arjita-mitra arjita-mitra enabled auto-merge April 22, 2026 07:30
@arjita-mitra arjita-mitra added this pull request to the merge queue Apr 22, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@arjita-mitra arjita-mitra added this pull request to the merge queue Apr 22, 2026
Merged via the queue into dev with commit fd4f51e Apr 22, 2026
82 checks passed
@arjita-mitra arjita-mitra deleted the bugfix/stale-search-result-drive-WPB-20817 branch April 22, 2026 07:56
thisisamir98 added a commit that referenced this pull request May 4, 2026
…e search box is empty(WPB-20817) (#21066)"

chore: Revert "fix: Search results are not fetching all files when the search box is  empty(WPB-20817) (#21066)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants