Skip to content

Fix Content route commits on slow networks#2372

Open
3mdistal wants to merge 2 commits into
mainfrom
codex/content-slow-network-route-commit
Open

Fix Content route commits on slow networks#2372
3mdistal wants to merge 2 commits into
mainfrom
codex/content-slow-network-route-commit

Conversation

@3mdistal

@3mdistal 3mdistal commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

With global network throttling, creating a page from Content's sidebar left the browser on the previous /page route and replaced the editor with a full skeleton while the root route reloaded locale data. The optimistic page and its Page/Database chooser were therefore hidden even though the new page identity already existed locally.

This is the intentionally separate follow-up to the issue found while validating #2363. It does not modify, absorb, or block that PR.

Approach

Let ordinary client-side path navigation commit without re-running the bootstrap-only root locale loader, while retaining React Router's default revalidation for form/action submissions. Separately, let authorized users choose Page while collaboration connects; authorization, body hydration, and database conversion still disable that choice, and Database retains its stricter pending gate.

What changed

  • added root-route revalidation policy and focused coverage for navigation versus action submissions
  • narrowed the pending Page-choice gate to the states that actually prevent that operation
  • added the required Content changelog entry

Safety and scope

Verification

  • 65 focused route, layout, editor, hydration, and sidebar tests passed
  • 22 targeted root/sidebar tests passed for direct local-file mode and database-backed workspaces containing imported local files; the creation branches themselves are unchanged by this diff
  • local typecheck, production build, and oxfmt passed
  • the full GitHub CI matrix is green on head b6522362d39a54d28db5e3b5ef3decef75dad352, including Content DB tests, fast tests, build, typecheck, lint/format, Content parity, security guards, and SSR cold-start smoke
  • independent real-browser QA used an 8-second global CDP network delay: click → /page/<id> route commit measured 65.3 ms with Page enabled and Database disabled
  • keyboard activation of disabled Database produced zero conversion requests; after persistence, one Database click produced exactly one conversion without a reload
  • back/forward preserved the route and Content shell; normal-speed route commit measured 122.7 ms; reload restored the signed-in shell and en-US/ltr locale state
  • no Builder operations or Notion OAuth/sync/write operations were initiated; only passive Notion status reads were observed

Review focus

  • confirm the root loader is bootstrap-only for ordinary path changes while action submissions retain default revalidation
  • confirm the Page gate remains closed for viewers, body hydration, and active database conversion
  • confirm the follow-up composes with Fix new-page database conversion race #2363 without taking ownership of its Database conversion behavior

Unrelated observations

  • the first Content DB CI attempt failed during dependency installation because the runner lacked pixman-1; one failed-job rerun installed successfully and the actual Content DB suite passed
  • the successful local build continues to emit existing repository doctor warnings; none originate from the files changed here

@netlify

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Visual recap — generation failed

The visual recap could not be generated for this pull request. This is informational only and does not block the PR.

Diagnostic:

No plan URL: Repair changed too much of targeted file plan.mdx; expected a localized parser fix.

Agent output: Repaired recap-source.json: both wireframe HTML attributes now use parser-safe double-quoted JavaScript expressions. JSON and non-empty MDX were verified; nothing was published. --- ⠀ 🟢 Visual recap source repaired and ready for the hosted parser retry. stderr: Reading additional input from stdin...

@builder-io-integration builder-io-integration 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.

Builder reviewed your changes — looks good ✅

Review Details

Code Review Summary

PR #2372 makes a focused Content-route change: ordinary navigations no longer wait for the root locale loader, while action/form-driven revalidation continues to follow React Router's default behavior. It also separates the new-document Page chooser from the broader collaboration readiness gate, preserving usability while collaboration connects while still blocking on edit authorization, body hydration, and database conversion; the Database path retains its stricter editor gate.

The approach is sound and well covered by targeted tests. The shouldRevalidate tests verify both ordinary navigation and action submission behavior, and the body-hydration tests cover the intended Page-choice states. The changelog entry is appropriately scoped. One review agent raised a collaboration-loading concern, but source and tests confirm that excluding that state from the Page button is intentional per the PR's stated behavior; the Database button remains protected by the existing editorCanEdit gate.

Risk assessment: Standard, because this changes route revalidation and editor interaction state, but does not alter authentication, payments, schema, or destructive data behavior. No confirmed reportable bugs found.

✅ Focused route and chooser coverage is included.
✅ Action-driven revalidation behavior is preserved.
✅ Database conversion remains protected against interaction while pending.

🧪 Browser testing: Skipped — dev server is healthy, but browser verification was attempted and could not run because Chrome automation tools were unavailable in executor sessions; all planned cases were marked couldnt_verify/env_issue.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

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.

2 participants