Skip to content

Fix offline access render loop and restore browser integration checks - #271

Merged
brianorwhatever merged 3 commits into
mainfrom
fix/260-offline-monitor-render-loop
Oct 4, 2026
Merged

brianorwhatever merged 3 commits into
mainfrom
fix/260-offline-monitor-render-loop

Conversation

@brianorwhatever

@brianorwhatever brianorwhatever commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Authenticated routes could render a blank page after the private-revocation changes: OfflineAccessMonitor passed a new request object to Convex useQueries on every render, triggering an infinite React render loop. Memoize each subscription request, including signed-out requests, and keep default item locators stable.

Add a regression using the real Convex React hooks covering sign-in, list/item/draft batches, revocation delivery, token renewal, account switching and sign-out. It fails on main with “Too many re-renders” and passes with this fix. Update the browser fixture for current access/profile APIs and the existing publication/branding copy so the restored suite can exercise current main.

Related to #260; this fixes a regression, not the outstanding legacy URL cutover, ambiguous offline-work recovery, or live/native verification criteria.

Validation: latest commit dfd0c42 passes CI unit tests, all 116 browser tests, web build, Android build, unsigned iOS build check, Lighthouse and automated review. Focused monitor suites, frontend/backend/E2E TypeScript and changed-source lint passed locally. The real-hook regression fails before the production fix and passes after it. Independent delegated review findings were fixed and follow-up review found no remaining issues. A broad local rerun hit disk exhaustion; complete CI suites passed. GitHub reports no merge conflict. Live/native cutover behavior remains outside this regression fix.

Note

Fix offline access render loop by memoizing Convex query configs in OfflineAccessMonitor

  • Memoizes the identity, access, and draft query configurations passed to useQueries in OfflineAccessMonitor.tsx. Each config rebuilds only when the auth token or relevant inputs change, and clears to an empty config while signed out. This stops a render loop from unstable request objects.
  • Adds a Convex subscription lifecycle test in offline-monitor-subscription.test.mjs that mounts the monitor with a fake Convex client and covers subscription creation, token updates, reconciliation, and sign-out cleanup.
  • Extends the fixture query dispatcher in server.mjs with responses for offline account, access, draft, list-grant, and display-name queries.
  • Updates e2e tests for the boop OG image path and the new share-modal publish/unpublish terminology.
  • Behavioral Change: protected identity, list/item, and draft subscriptions are now removed when the session token or account ID is absent.

Macroscope summarized 36eb544.

@railway-app

railway-app Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the boop-pr-271 environment in Friends

Service Status Web Updated
boop ✅ Success (View Logs) Web Oct 4, 2026 at 10:29 pm UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ No critical issues. One test assertion could be tighter.

Reviewed changes

I reviewed the fix for the OfflineAccessMonitor render loop, the new real-hook regression test, and the browser fixture and copy updates that bring the restored e2e suite back in line with main.

  • Stable useQueries requests: all three useQueries call sites now memoize their request object, including the signed-out {}. Before, Convex's useSubscription called setState during render on every new object identity, which looped forever. I confirmed that the memo deps on parent-supplied batch arrays still change on each parent render. That costs one extra render per change but cannot loop, and QueriesObserver.setQueries compares args by JSON, so no subscriptions churn.
  • Regression test with real Convex hooks: I checked scripts/offline-monitor-subscription.test.mjs both ways. With main's OfflineAccessMonitor.tsx it fails with "Too many re-renders". On this branch it passes under both node --test and bun test, alongside the existing offline-access-monitor.test.mjs.
  • Browser fixture queries: the getOfflineAccess / getOfflineDraftAccess responses match the shapes in convex/items.ts (presentItemIds, missingItemIds, canEdit, checkedAt), and getOfflineAccount now returns did.
  • e2e copy: the new strings ("Publish publicly", "Share list", "Unpublish", "This list is published publicly", og-image-boop.png) match the current ShareModal.tsx and index.html.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread scripts/offline-monitor-subscription.test.mjs
@railway-app
railway-app Bot temporarily deployed to Friends / boop-pr-271 October 4, 2026 22:26 Destroyed

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found. The earlier test-assertion feedback is addressed.

Reviewed changes

I reviewed the two commits pushed since the prior review at 36eb544.

  • Tightened the account-switch assertion: the regression test now asserts active.size === 4 after the account switch, so it can no longer pass vacuously. It passes locally under node --test.
  • Updated tests/sharing.e2e.ts copy: the new strings ("Share list", "Publish publicly", "This legacy invite link is no longer supported") match the current <h2> and button text in ShareModal.tsx and JoinList.tsx.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@brianorwhatever
brianorwhatever merged commit 922ccaa into main Oct 4, 2026
10 checks passed

This branch was successfully deployed

No deployments
Friends / boop-pr-271 — dfd0c420 Deployed Oct 4, 2026 by railway-app[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