Repository navigation
fix(flow): bound scene clip addition wait and confirm on timeout - #28
Conversation
- Check verified store, preview, voice, and scene formats newest first. - Use the newest field layout for tile, trim, and scene mutations. - Enforce a 10-second timeout when scene clip additions wait to finish. - Fall back to the page upload menu when direct media upload fails. - Run tile rename, tile trash, and collection list without a store. - Locate media, character, scene, and collection tiles in the grid. - Manage collections through page controls when store writes fail. - Save character personality notes in the editor when store edits fail. - Require a verified build for Agent chat, files, and settings.
|
Please send the scene clip addition timeout as a separate change based on |
- Keep the verified build check before scene writes run - Stop before scene writes on unknown builds with unsupported_front_end - Limit the add_clips completion callback wait to 10 seconds - Read project tiles on callback timeout to confirm added scene clips - Report outcome_unknown when a read does not confirm the clip change
|
Updated this PR on top of
|
byteland-app
left a comment
There was a problem hiding this comment.
A timeout can report confirmed: true after an optimistic local cache update. I reproduced this locally with a verified build, a mutator that appends the clip only to the cache, and no server fetch or completion callback. ts/scene_ops.ts:332–349 accepts local rows, and ts/project_store.ts:527–537 also falls back to them. Require a fresh read from the server before you report success. Retain the pending write guard until the first request settles or the server confirms the intended order and count. Add a regression check for a retry while the first write is still pending.
- Require a fresh server fetch before confirming timed-out clip writes - Check exact clip order and count when confirming scene additions - Retain projectMutationPending until settlement or server confirmation
|
Addressed in
|
|
Changes requested.
This review is from static reading. It is not verified on live Flow. |
- Resolve add_clips wait when mutate resolves without a callback. - Isolate mutationChain gates per payload with a WeakMap. - Run pre-write scene checks before submitting add_clips writes. - Prefix call_flow_async errors only when a write may have run.
|
Addressed in
|
|
I reviewed this pull request on top of current
The useful part is small: after a timeout, the caller gets |
- Release the project write guard when the baseline read fails - Read the source media ID through the build media container - Poll the store for up to eight reads before an unknown outcome - Remove the unreachable success branch and report the error detail - Treat JavaScript errors as possible writes in the scene tool
Summary
Bound the scene clip addition wait on top of
mainwhile settling immediately whenmutateresolves, isolating per-mutation serialization gates, keeping server-only confirmation reads, and scopingoutcome_unknownerror prefixes to post-submit failures.ts/scene_ops.ts,src/scenes.rs): Keep theactiveProjectStoreFormat()check beforecreate,prepare_add_clips, andadd_clipsoperations. When the active Flow build is unknown, stop before the write and reportunsupported_front_end.mutateresolution or bounded callback wait (ts/scene_ops.ts): Resolve theadd_clipswait whenmutateresolves (callbackErr === null), matchingcreateSceneints/angular.ts, as well as whenDe.resolveorve.resolveruns. Reject immediately onDe.rejectormutaterejection, and cap hung requests at10seconds (SCENE_ADD_CLIPS_TIMEOUT_MS = 10_000).ts/project_store.ts,ts/scene_ops.ts,src/scenes.rs): When bothmutateand callbacks time out after submission, fetch fresh project rows from the server (fetchProjectStore->refreshProjectStoreviaquery.fetch) with no fallback to cached store rows. Returnok: true(confirmed: true) only when the fresh server read confirms the intended clip order and count; otherwise reportoutcome_unknownwithproject_id,stage,scene_id, andasset_ids.ts/project_store.ts,ts/scene_ops.ts): TrackmutationChainrelease promises per payload with aWeakMap(mutationGates) viaProjectMutationGuard.attach, so finishing one server-confirmed timeout unblocks only its ownmutationChainlink while concurrentmutateStorecalls stay serialized. RetainprojectMutationPending(releaseOnMutateSettle) when an unconfirmed write remains pending, rejecting retries withproject_mutation_pending.outcome_unknownerror prefix (ts/scene_ops.ts,src/scenes.rs): Runprepare_add_clipsand checkengine.has_page()before submittingadd_clips, and apply theoutcome_unknownprefix insrc/scenes.rsonly when a Chrome CDP error occurs after the request can have reached the browser (write_could_have_happened).Verification
cargo xtask ci,RUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --no-deps --document-private-items,RUSTFLAGS="-D warnings" cargo build --release --locked --bin flow-mcp,cargo xtask collect-licenses, andcargo deny --locked --workspace check.flow-mcp serveover standard input and output against headless Chrome (9/9checks passed):mutateresolution without callbacks settling in< 2.5seconds, fast callback rejection clearingprojectMutationPending, 10-second timeout with fresh server read confirming positioned clip order and count while keeping subsequent concurrentmutateStoreoperations strictly serialized, optimistic local cache update with no server fetch reportingoutcome_unknownand blocking retries withproject_mutation_pending, pre-write refresh failure and pre-write CDP disconnect omittingoutcome_unknown, mid-write CDP disconnect prefixingoutcome_unknown, server read with wrong clip order reportingoutcome_unknown, and unknown builds stopping before writes withunsupported_front_end.