Skip to content

fix(masters): retry transient hydration races - #833

Merged
axisrow merged 2 commits into
mainfrom
ao/direct-cli-99/issue-829
Aug 13, 2026
Merged

fix(masters): retry transient hydration races#833
axisrow merged 2 commits into
mainfrom
ao/direct-cli-99/issue-829

Conversation

@axisrow

@axisrow axisrow commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Closes #829

Summary:

  • retry the idempotent campaign-menu open sequence more generously when React mounts menu items late
  • retry transient contenteditable clear failures before reporting an update error
  • add regression coverage for a flaky clear handler

Tests:

  • pytest -q tests/test_masters.py -k "transient_contenteditable_clear_failure or archive_master or resume_from_archived"
  • black --check direct_cli/browser/masters.py tests/test_masters.py
  • git diff --check

…rify budget

Issue #829 reported four failure shapes on long sequential Masters batch
runs; the previous commit on this branch (b34297a) fixed only two
(menu-item-not-found, contenteditable clear). This closes the remaining
two, including the most frequent one:

- archive_master: the pre-click TOCTOU re-check
  (_reverify_status_or_raise) raised immediately when the overview page's
  status text was transiently unrecognised, even though its own internal
  60s hydration poll had already run out — a single dead-end, not a real
  "another session changed it" signal. archive_master now retries the
  whole open-menu -> re-verify -> click sequence once more via a fresh
  page re-navigation (_click_menu_item_with_reverify_retry), while the
  genuine "status changed to something else" TOCTOU case still aborts
  immediately, never retried (new _TransientUnrecognisedStatusError
  distinguishes the two). copy_master is deliberately left out: it is
  non-idempotent, so retrying through a false "changed" reading risks a
  worse failure (a duplicate campaign) than reporting it.

- update_master's post-save verify (_verify_saved): the existing
  reload-retry budget (_VERIFY_RELOAD_MAX_ATTEMPTS, added for issue #790)
  already re-navigates on a stale post-save read, but 3 attempts still
  wasn't enough headroom for a busier account under sustained sequential
  load per issue #829's log. Raised to 4.

Tests: TestArchiveMaster::test_retries_transient_unrecognised_status_
before_archiving, TestVerifyTrackingParamsReloadRetry::
test_recovers_after_multiple_consecutive_stale_reads — both red before
the fix (verified), and mutation-checked (reverting the constants back
makes them fail again for the right reason).

Verified: 894/894 tests/test_masters.py pass, 3543/3543 full suite pass,
black + flake8 clean, git diff --check clean.

Closes #829
@axisrow

axisrow commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

🔍 Local review (cycle 1) — round 13a681d2-a036-4bce-b1ec-e296c5634dc8

Reviewed locally (/review + Codex companion), no bots pinged.

Verdict Reviewer Finding Location
HALLUCINATION claude Claimed loss of diagnostic cause-chain info on a repeat clear-failure was checked against the pre-PR code and does not hold; behavior there is unchanged direct_cli/browser/masters.py:4375
SKIP claude Reviewer flagged the archive retry-loop shape as a duplicate pattern of an existing retry loop but explicitly noted it is not a functional bug direct_cli/browser/masters.py:3388
(clean) codex No findings — approve verdict, no critical issues in the diff

Totals: 0 FIX, 1 SKIP, 1 HALLUCINATION, 0 UNVERIFIED.

@axisrow

axisrow commented Aug 13, 2026

Copy link
Copy Markdown
Owner Author

📋 Review summary — all cycles

Cycle Reviewer Finding Verdict Resolution
pre-review (completeness check) PR initially covered only 2 of 4 failure modes named in the linked issue FIX Fixed in 8e15453 (archive retry-on-transient-status + widened save-verify budget)
1 claude Claimed loss of diagnostic cause-chain info was checked against pre-PR code and does not hold HALLUCINATION Left as-is — no behavior change vs pre-PR code
1 claude Archive retry-loop shape duplicates an existing retry pattern; reviewer confirmed no functional bug SKIP Left as-is — reviewer confirmed non-issue
1 codex (no findings — approve)

Totals: 1 FIX (all resolved), 1 SKIP, 1 HALLUCINATION, 0 UNVERIFIED.

@axisrow
axisrow merged commit 5fcd7e9 into main Aug 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant