mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 16:02:36 +00:00
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>
17 lines
887 B
SQL
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');
|