Skip to content

Fix enrolled sync startup ordering - #188

Merged
FelineStateMachine merged 1 commit into
mainfrom
feat/fix-sync-enrollment-startup
Jul 20, 2026
Merged

Fix enrolled sync startup ordering#188
FelineStateMachine merged 1 commit into
mainfrom
feat/fix-sync-enrollment-startup

Conversation

@FelineStateMachine

Copy link
Copy Markdown
Owner

Motivation

During a CUA passkey/backup/stop-sync cycle on demo.lofi.host, the account panel could report Backed up & syncing while Device Report and node activity showed that the shared runtime had opened local-only. A client:load island could call getRuntime() before the boot script finished unsealing the declared sync location. The early runtime then remained local-only even though later account reads saw the enrolled sink.

Change

  • store the document's declared-sink cache and restore state on globalThis so duplicate Astro island module instances share one result
  • single-flight the sealed sink restore across boot and eager app islands
  • make first runtime creation await that shared restore before selecting local or managed mode
  • refresh Device Report's session snapshot as runtime diagnostics advance
  • add regression tests for duplicate island instances and the boot/runtime restore race
  • give the demo severity select a form-field name and cover it in the overlay contract test

Testing Completed

  • deno task check
    • 466 unit tests passed
    • 18 access tests passed
    • 3 effects tests passed
    • 24 schema/conformance tests passed
    • 3 scenario tests passed
  • targeted runtime/session/device-status tests — 34 passed
  • CUA on demo.lofi.host: incident CRUD, account-recovery passkey creation, guarded 24-word recovery-phrase display, stop syncing, and reload
  • reload returned to ready durable storage without a boot loop; browser local data did not need to be cleared

Remaining Work

  • merge and release the companion node CORS fix: Fix browser requests through the ticket gate lofi-node#20
  • deploy a demo bundle containing this change
  • repeat the production CUA cycle and verify the derived sync ticket is used, an incident reaches global confirmation, stop-sync disconnects, and reload stays local-only
  • consider adding a full browser regression that deliberately delays sink unsealing while an island requests the runtime

Responsible AI Disclosure

OpenAI Codex assisted with source exploration, CUA reproduction, implementation, GitNexus impact analysis, and test execution. The changes remain subject to normal maintainer review.

@FelineStateMachine
FelineStateMachine marked this pull request as ready for review July 20, 2026 18:29
@FelineStateMachine
FelineStateMachine merged commit 8d803da into main Jul 20, 2026
3 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

Development

Successfully merging this pull request may close these issues.

1 participant