Files
windmill/backend/tests/fixtures/drafts_save_by_id.sql
T
Guilhem LemouelandClaude Fable 5.1 ab296e59c1 feat: save drafts by row id, so an open editor follows its draft through a move
A rename carries every draft on the item to the new path. An editor left open
across it was still saving by the path it opened on, which the server had to
refuse and answer with where the item went (the "moved" handshake and its
modal). The draft row has an id: the get-by-path overlay now returns it as
draft_id, every later save sends it, and the server writes the row wherever it
is and answers with that path. The editor then follows: it flushes what it holds,
tells the user, and navigates to the item's new path, where the stale prompt
says what changed. The lineage-based move resolvers, the moved status and the
moved modal are gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 12:05:00 +02:00

17 lines
887 B
SQL

-- Fixture for saving a draft by row id across a rename.
--
-- A deployed script at `u/test-user/byid_a` (hash 7030 = 0x1b76) with the
-- deployer's own draft on it. The test renames the script and then saves the
-- draft by id from an editor still bound to the old path.
INSERT INTO script (workspace_id, hash, path, content, language, kind, created_by,
schema, summary, description, lock, extra_perms)
VALUES ('test-workspace', 7030, 'u/test-user/byid_a',
'export function main() { return 1 }',
'deno', 'script', 'test-user', '{}', 'A', '', '', '{}');
INSERT INTO draft (id, workspace_id, path, typ, value, email, base)
VALUES (9001, 'test-workspace', 'u/test-user/byid_a', 'script',
'{"path": "u/test-user/byid_a", "parent_hash": "0000000000001b76", "summary": "A", "content": "draft"}',
'test@windmill.dev', '0000000000001b76');