Warn when an encrypted search runs before the index has finished building#34001
Open
hayaksi1 wants to merge 1 commit into
Open
Warn when an encrypted search runs before the index has finished building#34001hayaksi1 wants to merge 1 commit into
hayaksi1 wants to merge 1 commit into
Conversation
…ding When a search runs in an encrypted room while the local Seshat index is still crawling not-yet-indexed history, results can silently come back partial. SearchWarning now subscribes to the event index's changedCheckpoint progress and shows a polite (role=status) notice while the crawl is in progress, clearing automatically the moment indexing finishes.
Member
|
Please include a screenshot of the warning for design to review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a search runs in an encrypted room while the local Seshat index is still being
built (crawling not-yet-indexed history), the search can silently return partial
results, with nothing to tell the user that more matches may appear once indexing
finishes (#32253).
Fix
SearchWarningnow observes the event index's crawl progress:useIsCrawlInProgresshook subscribes to the index'schangedCheckpointevent(emitted as each checkpoint drains) and tracks whether
currentRoom()is stillnon-null — i.e. the crawl is still running.
(
WarningKind.Search), a polite live-region notice — "Results may be incompletebecause your search index is still being built." — is rendered with
role="status",so a screen reader announces it if it appears while a search panel is already open.
every checkpoint change), and the listener is removed on unmount.
No behaviour changes for unencrypted rooms, for the no-index / index-error paths, or for
the files warning.
Tests
SearchWarning-test.tsxcovers: no warning when the index is complete, the partial-resultswarning while crawling, auto-clear when the crawl finishes, listener cleanup, and that the
notice is scoped to search rather than the files warning.
Fixes #32253
Checklist
public/exportedsymbols have accurate TSDoc documentation.