Skip to content

fix: #14337 (rebased onto main, draft) - #16194

Closed
christian-byrne wants to merge 0 commit into
mainfrom
christian-byrne/fix-14337-rebased-onto-main
Closed

christian-byrne wants to merge 0 commit into
mainfrom
christian-byrne/fix-14337-rebased-onto-main

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

Draft: fix #14337, rebased onto main.

Full context for agent readers Rebase of the earlier fix branch onto current main so it is mergeable independently of the CRDT train.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 798bba38-82c2-495f-9ca5-66ad133ccb0d

📥 Commits

Reviewing files that changed from the base of the PR and between cc90b05 and 01facd4.

📒 Files selected for processing (8)
  • src/composables/auth/useAuthActions.test.ts
  • src/composables/auth/useAuthActions.ts
  • src/platform/workflow/persistence/base/storageIO.test.ts
  • src/platform/workflow/persistence/base/storageIO.ts
  • src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.test.ts
  • src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.ts
  • src/platform/workspace/stores/useWorkspaceAuth.test.ts
  • src/platform/workspace/stores/workspaceAuthStore.ts

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.


📝 Walkthrough

Walkthrough

Changes

The PR replaces independent workflow storage flags with explicit transition states. Cloud logout now clears storage while writes remain fenced until user and team-workspace readiness. Workspace transition cancellation uses an owner-scoped callback.

Workflow storage transitions

Layer / File(s) Summary
Storage transition state machine
src/platform/workflow/persistence/base/storageIO.ts, src/platform/workflow/persistence/base/storageIO.test.ts
Storage reads and writes use transition-aware state checks. Workspace and logout transitions preserve prior availability and expose explicit completion or cancellation behavior.
Cloud logout recovery
src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.ts, src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.test.ts
Cloud logout cancels pending persistence, clears workflow storage, and resumes writes after user resolution and team-workspace readiness.
Authentication transition integration
src/composables/auth/useAuthActions.ts, src/composables/auth/useAuthActions.test.ts, src/platform/workspace/stores/workspaceAuthStore.ts, src/platform/workspace/stores/useWorkspaceAuth.test.ts
Authentication logout prepares the transition before cleanup. Workspace session cleanup invokes deferred cancellation only when no reload occurs. Tests verify ordering and failure behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 01fac

The current changes do not introduce a concrete correctness, security, availability, or deployment risk and are merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant AuthActions
  participant WorkflowPersistence
  participant StorageIO
  participant TeamWorkspaceStore
  AuthActions->>WorkflowPersistence: authenticate logout
  WorkflowPersistence->>StorageIO: prepareWorkflowLogoutTransition
  WorkflowPersistence->>StorageIO: clearAllWorkflowStorage
  WorkflowPersistence->>TeamWorkspaceStore: wait for workspace readiness
  TeamWorkspaceStore-->>WorkflowPersistence: active workspace ready
  WorkflowPersistence->>StorageIO: completeWorkflowLogoutTransition
Loading

Possibly related PRs

Suggested labels: size:L, risk:R3

Suggested reviewers: dante01yoon


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore (reviewers only)

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ❌ Error The commit subject “fix: model workflow storage transitions explicitly” uses bug-fix language. The PR changes application files under src/ and no file under browser_tests/. The PR description only… Add or update a Playwright regression test under browser_tests/, or add a concrete explanation in the PR description explaining why an end-to-end regression test is not practical.
Description check ⚠️ Warning The description only states that this is a rebased draft. It does not provide the required Summary, Changes, Review Focus, or applicable verification details. Add the required template sections. Summarize the explicit workflow storage transition changes, document breaking changes and dependencies, identify review focus and verification results, and reference issue #14337.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the related fix as issue #14337, but it emphasizes rebase and draft status instead of the primary change. It remains related to the pull request.
Linked Issues check ✅ Passed The changes implement the objectives in #14337. They model storage transitions explicitly, preserve availability during transitions, add owner-scoped workspace cancellation, cancel logout persistence,…
Out of Scope Changes check ✅ Passed The changed production files and tests directly support #14337. No unrelated code changes are identified. Watcher-command refactoring and zero-registrant diagnostics remain out of scope as stated.
Website End-To-End Regression Coverage ✅ Passed No changed file is under apps/website/src/ or apps/website/public/. The listed changes are workflow, authentication, persistence, and workspace files under src/. The website-specific check does …
Adr Compliance For Entity/Litegraph Changes ✅ Passed PASS. The changed-file list contains only authentication, workflow persistence, and workspace-auth files. No files under src/lib/litegraph/, src/ecs/, or graph-entity-related files are listed. The…
Full details: Linked Issues check

Explanation

The changes implement the objectives in #14337. They model storage transitions explicitly, preserve availability during transitions, add owner-scoped workspace cancellation, cancel logout persistence, wait for workspace readiness, and cover the required regression scenarios.

Full details: End-To-End Regression Coverage For Fixes

Explanation

The commit subject “fix: model workflow storage transitions explicitly” uses bug-fix language. The PR changes application files under src/ and no file under browser_tests/. The PR description only states that the PR rebases a fix and does not give a concrete reason why an end-to-end regression test was not added.

Full details: Website End-To-End Regression Coverage

Explanation

No changed file is under apps/website/src/ or apps/website/public/. The listed changes are workflow, authentication, persistence, and workspace files under src/. The website-specific check does not apply.

Full details: Adr Compliance For Entity/Litegraph Changes

Explanation

PASS. The changed-file list contains only authentication, workflow persistence, and workspace-auth files. No files under src/lib/litegraph/, src/ecs/, or graph-entity-related files are listed. The ADR 0003 and ADR 0008 checks are therefore not applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch christian-byrne/fix-14337-rebased-onto-main
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch christian-byrne/fix-14337-rebased-onto-main

Comment @coderabbitai help to get the list of available commands.

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

issue: GitHub reports this PR as DIRTY, so the proposed workflow-persistence change is not yet reviewable as an integrable result.

Full context

Please resolve the branch against current main and rerun the auth, workflow-persistence, and browser suites at the resolved head. The transition-owner logic is only meaningful once current callers and the conflict resolution are tested together, including cloud logout, workspace switch, reload, revoked-workspace handling, and stale cleanup closures.

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes: this branch was never rebased onto main, and its entire payload is already merged. I think it should be closed rather than fixed, but flagging rather than acting since it is your draft.

The fix is already on main

#14337 ("fix: model workflow storage transitions explicitly") merged to main on 2026-08-22T23:55:47Z as cb66aee9f7, and that commit is an ancestor of main today (cb66aee...main = ahead 227, behind 0) — it was not reverted. main currently exports the whole transition API from storageIO.ts:

  • prepareWorkflowWorkspaceTransition() (line 488)
  • prepareWorkflowLogoutTransition() (line 517)
  • completeWorkflowLogoutTransition() (line 528)
  • clearAllWorkflowStorage() with the blockWrites option removed (line 541)

and useAuthActions.ts on main already calls prepareWorkflowLogoutTransition(); clearAllWorkflowStorage().

I diffed this head against main file by file. storageIO.ts — the actual subject of the PR — is byte-identical to main (0 lines of difference).

The title is inaccurate

The merge base of this PR is 795292d907 (2026-08-22T21:17:32Z), which is one commit before cb66aee9f7. So the branch was cut just ahead of its own fix landing and is ahead=1, behind=228. gh pr diff therefore renders the change against a stale base and looks like new work; against main it is a re-application. "rebased onto main" is not what happened.

Merging it would revert nine days of unrelated work

This is why I am blocking rather than just noting it. The three other files are 228 commits behind, so merging this head would undo, in main → this-head direction:

  • useAuthActions.ts — drops watchForTopupBalanceUpdate, usePendingTopup, and the entire POPUP_PERMISSION_ERROR_CODES branch from #14944 ("warn instead of erroring on blocked or cancelled sign-in popups"), plus the top-up balance refresh from #14876 / f71da5b09.
  • workspaceAuthStore.ts — drops the unified-auth telemetry (#16007-era useTelemetry / UnifiedAuthRefreshOutcome) and, worse, the whole bounded-backoff re-arm for the proactive unified refresh (1677fc06b, FE-1595). That code's own comment states the consequence of its absence: "cookie-authenticated <img>/media loads have no 401-retry path of their own and stay broken once the session cookie expires".
  • useWorkflowPersistenceV2.ts — reverts the fence-release fix, replacing isWorkspaceInitConcluded (ready or error) with isWorkspaceReady (ready only). main's comment says exactly why that regressed: "Waiting on 'ready' alone would leave writes blocked for the rest of the session if init settles on 'error'". It also re-adds workflowName: null arguments that d22005cb8 removed with the V1 persistence fallbacks.

What I would do

Close this PR. If there is residual work you wanted from that branch beyond what #14337 landed, an actual git rebase origin/main will show it — and based on storageIO.ts being identical, I expect the rebase to come out empty.

If I have misread the intent and this is deliberately reverting something, could you say which of the three files' current main state you mean to change, and why? Right now the diff reads as an accident of a stale base rather than a decision.

Validation: compared main against head 01facd45e2 per file; resolved the #14337 merge commit and its ancestry; listed the post-cb66aee commits touching each of the four source files. No tests run — the finding is about branch state, not behavior.

await authStore.logout()
if (isCloud) clearAllWorkflowStorage({ blockWrites: true })
if (isCloud) {
prepareWorkflowLogoutTransition()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue: these two lines are already on main verbatim (useAuthActions.ts:138-139), landed by #14337 in cb66aee9f7 on 2026-08-22. The diff only looks like a change because this branch's merge base (795292d907) is one commit older than that merge.

The blocking part is not the redundancy, it is what else this file carries at this revision. Merging this head would remove from useAuthActions.ts:

Same pattern in workspaceAuthStore.ts (loses the FE-1595 unified-refresh backoff re-arm) and useWorkflowPersistenceV2.ts (loses the ready-or-error fence release).

Could you confirm this branch is just stale and close it? A real rebase onto main should reduce this file to no change at all.

@christian-byrne
christian-byrne force-pushed the christian-byrne/fix-14337-rebased-onto-main branch from 01facd4 to 69d5d3c Compare August 31, 2026 20:37

This branch was previously deployed

1 inactive deployment
github-pages — 69d5d3ca Deployed Aug 31, 2026 by github-merge-queue[bot] via deploy #22176
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