fix(app-center): fence stale factory snapshots#1472
Conversation
| // Any authoritative factory snapshot supersedes reads that started before | ||
| // it, including the factory half of an in-flight full refresh. | ||
| this.factoryLoadSequence += 1; |
There was a problem hiding this comment.
🟡 Core controller file grows further past the mandated size limit
New logic is added to a core controller file that is already 882 lines (appCenterControllerState.ts:88-111), which exceeds the repository's 800-line business-code ceiling and its rule to decompose before adding more logic.
Impact: The file drifts further past the size limit the repository requires, deferring the decomposition the rules mandate.
Repository size-limit rule
Both AGENTS.md ("Business-code files should stay at or below 800 lines. Prefer decomposition before adding more logic.") and CONTRIBUTING.md ("Business-code files should stay at or below 800 lines; crossing the limit is a refactoring signal") set an explicit 800-line ceiling for business-code files. packages/workspace/app-center/src/core/appCenterControllerState.ts is 882 lines, and this PR adds the factoryLoadSequence increment logic at appCenterControllerState.ts:92-94 rather than decomposing first.
Prompt for agents
The file packages/workspace/app-center/src/core/appCenterControllerState.ts is 882 lines, exceeding the repository's 800-line business-code limit documented in AGENTS.md and CONTRIBUTING.md. The rule states to prefer decomposition before adding more logic. Consider extracting cohesive groups of methods (e.g. the install-refresh scheduling helpers, or the snapshot-application helpers) into a separate module to bring the file back under the 800-line ceiling before or as part of adding this new fencing logic.
Was this helpful? React with 👍 or 👎 to provide feedback.
Signed-off-by: jomeswang <1551403343@qq.com>
1f5bc03 to
4aacafc
Compare
Summary
agentTargetIdchanges as meaningful factory-job state changes@tutti-os/workspace-app-centerRoot cause
The shared controller sequenced only list requests against other list requests. A newer host-pushed snapshot did not advance that sequence, so an older initial GET could complete later and replace the authoritative snapshot with an empty result. Factory-job equality also omitted
agentTargetId, which could suppress a navigation-target update.Validation
pnpm --filter @tutti-os/workspace-app-center test— 117 passedpnpm --filter @tutti-os/workspace-app-center typecheck— passedpnpm check:changed— 8 lanes passed after rebasepnpm check:changed -- --push-ready— 9 lanes passedCompatibility and rollback
No public API or persisted-data shape changes. The changeset is patch-level. Rollback is a single commit revert; consumers that retain their own host-side stale-read fence remain safe during a staggered rollout.