mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 08:02:43 +00:00
fix: check for invalid JSON after the editors have parsed what was flushed
The JSON editors parse a flushed buffer in an effect, so the check reads the registry after a tick, as RunForm and the page drawer already do. The message says the editor is in the preview. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d7f0df0315
commit
489d3b7677
@@ -47,11 +47,12 @@ export type MoveSessionResult =
|
||||
*/
|
||||
export async function flushPendingSaves(workspace: string): Promise<string | undefined> {
|
||||
flushAllPendingEditorChanges()
|
||||
// Text that does not parse never reaches the draft, and the move closes the editor holding it.
|
||||
if (anyEditorUnparseable()) {
|
||||
return 'An editor has changes that are not valid JSON. Fix them before moving.'
|
||||
}
|
||||
await tick()
|
||||
// Text that does not parse never reaches the draft, and the move closes the editor holding it.
|
||||
// After the tick: the JSON editors parse what was just flushed in an effect.
|
||||
if (anyEditorUnparseable()) {
|
||||
return 'An editor in the preview has changes that are not valid JSON. Fix them before moving.'
|
||||
}
|
||||
flushEditorSaves(workspace)
|
||||
await tick()
|
||||
const unsaved = await UserDraftDbSyncer.flushWorkspace(workspace)
|
||||
|
||||
Reference in New Issue
Block a user