Skip to content

fix(desktop-browser): refuse reissued earlier refs and recover from uncommitted ref reuse - #9959

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/browser-ref-safety
Nov 12, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/browser-ref-safety

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-up hardening for #9953 before it reaches main:

  • A ref from an earlier snapshot is refused once a later snapshot gave its element a new ref (a recycled virtual row's "Archive" button no longer lets the old ref act on the new row)
  • When the page reuses an id from a capture this scope never committed (an aborted or timed-out snapshot), the snapshot is recaptured once with the page's issued refs forgotten, instead of the frame staying unreadable or the tab failing every snapshot until it navigates
  • An icon-only control no longer counts as "revealed content" when its label grows, and the text hash is only computed when a name actually changed

Type of Change

  • Bug fix

Testing

  • Red/green unit tests: earlier ref after reissue, uncommitted reuse recapture (driver), icon-only label growth; 546 browser-agent tests pass, desktop type-check clean
  • Production-loop benchmark ablation to follow in a comment

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 12, 2026 11:01pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed.

Summary

The PR rejects earlier refs after an element receives a new ref and retries captures whose reused ids cannot be trusted.

The latest changes address both prior review threads:

  • An old ref stops working when its element gets a newer ref.
  • Invalid snapshots get one retry with fresh refs.
  • An icon-only control's old ref goes stale when its label changes.

No new actionable issues were found.

Reviews (2) · Last reviewed commit: "fix(desktop-browser): keep new markers a..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — 568c2def Deployed Nov 12, 2026 by vercel[bot]
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.

1 participant