fix(gmail-browser): search result integrity — settled-view primitive (#777) - #506
Merged
Milhouszhang merged 6 commits intoJul 9, 2026
Conversation
…led-view primitive
…ettled-view path - Remove the stale pre-refactor doc block stacked on poll_gmail_list_until (it described the old re-navigate loop, contradicting the settled-view impl). - Inline the identity wrapper should_wait_network_idle_after_previous_attempt (fn returning its argument) to a plain `if network_idle_reliable`, and move the misattached network-idle doc onto the real waiter wait_gmail_network_idle. Behavior-preserving cleanup; 919 unit tests plus live search E2E pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Fixes Gmail-browser search returning pre-filter inbox rows masquerading as search results (plan issue #777). Gmail's SPA commits
location.hashbefore it replaces the row grid, so a scrape run mid-transition could return the old#inboxrows under a new#search/...URL — a silent false success.Root cause
?authuser=<email>base URL triggered a full-page redirect that dropped the#searchfragment, landing back on#inbox.loading.Fix
open_gmail_view_settled— one primitive all action-path list reads (search + post-condition) now go through: navigate → wait network-idle (best-effort) → assert thehrefroute matches the URL's fragment route (href_on_route) → require the row signature to hold across two consecutive scrapes. Replaces three ad-hoc polling sites.gmail_base_urlfixed to the/u/0/path form so the hash fragment survives navigation.ok/empty instead ofloading.expected_route_of,href_on_route) reject thread-detail URLs so post-conditions force the real list view.Verification
cargo test -p puffer-cli), incl. route-assertion, pre-navigation-signature, and zero-result cases.milhouszhang@fuzz.land), three read-only scenarios:list_inbox→#inbox, 5 real rows (baseline).search newer_than:1d→#search/newer_than%3A1d, 6 rows; result set differs from inbox (includes newer mail absent from the inbox top-5, excludes an older Jul-7 notification) — proves real search results, not a stale grid.search from:<nonexistent>→#search/..., 0 rows + complete (not aloadinghang) — proves the zero-result fix.scripts/ci-gates.sh).Plan issue: agentenv/monorepo#777