fix: reject stale generation-tagged refs#55
Merged
Conversation
Contributor
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
Risk Assessment
Testing
npm test -- test/snapshot.test.ts test/interaction.test.ts test/run.test.ts test/main.test.tsnpm testPipeline
Updates from git push no-mistakes
✅ **Rebase** - passed
Round 1 - passed ✅
🔧 **Review** - 2 issues found → auto-fixed
Round 1 - found 2 issues (1 error, 1 warning)
src/cli.ts:962- The stale-ref check only compares against the last generation written by this CLI, so refs from the latest snapshot are still accepted after the page changes without another stamped snapshot, such as a timer-driven re-render,wait, or mutatingeval. That leaves the original silent no-op failure mode in place for a common stale-ref path despite the newSTALE_REFcontract.src/snapshot.ts:57- Stamping printed refs asg<N>:<uid>changes the public ref format, but therunhelper still only treats numeric refs as uids, sopage.click("@g1:1")orpage.fill("@g1:1", ...)will be handled as CSS selectors instead of DevTools refs.Round 2 (auto-fix) - passed ✅
✅ **Test** - passed
Round 1 - passed ✅
npm test -- test/snapshot.test.ts test/interaction.test.ts test/run.test.ts test/main.test.tsnpm test🔧 **Document** - 7 issues found → auto-fixed
Round 1 - found 7 warnings
src/cli.ts:112- Thescreenshot --uidcommand help still documents/examples untagged refs (@3) and does not explain that element refs in current snapshots are generation-tagged and may raiseSTALE_REF. Update this help section to match the new ref format and stale-ref behavior, like the updatedclickhelp.src/cli.ts:153- Thefillcommand help still documents/examples untagged refs (@3) and does not mention passing generation-tagged refs back exactly as printed or theSTALE_REFfailure mode introduced for stale refs.src/cli.ts:349- Thehovercommand help still documents/examples untagged refs (@5) and omits the new generation-tagged ref andSTALE_REFbehavior now applied before invoking the MCP hover action.src/cli.ts:361- Thedragcommand help still documents/examples untagged refs (@3 @7) and omits that both refs should be generation-tagged refs from the latest snapshot or the command can fail withSTALE_REF.src/cli.ts:374- Thefillformcommand help still documents/examples untagged refs (@1,@2, etc.) and does not describe generation-tagged field refs or stale-ref errors for multi-field form fills.src/cli.ts:399- Theuploadcommand help still documents/examples an untagged file-input ref (@5) and omits that refs from snapshot output are now generation-tagged and stale refs raiseSTALE_REF.README.md:209- The state-file documentation lists onlybridge.pid, but the change adds persistent snapshot generation state at~/.chrome-devtools-axi/snapshot-generation. Add this file to the state table so users understand the new persisted state used for stale-ref detection.Round 2 (auto-fix) - passed ✅
✅ **Lint** - passed
Round 1 - passed ✅
✅ **Push** - passed
Round 1 - passed ✅