fix(03): WR-06 surface move-failed distinctly with re-save guidance

This commit is contained in:
Lucas Berger
2026-06-09 10:41:55 -04:00
parent 7bc129f0f3
commit 1c71f8c980
2 changed files with 30 additions and 2 deletions
+16 -1
View File
@@ -50,7 +50,12 @@ export function SyncStateToast() {
})
const status = data?.status
const isConflict = status === 'failed' && data?.error?.includes('412')
// WR-06: an edit-as-move whose create hits 412 dead-ends with no retry path (the
// original event is preserved, but the new uid's only outbox row is failed). The
// worker tags that case with a 'move-failed:' lastError so we can show distinct copy
// guiding the user to re-open and re-save, rather than the etag-conflict copy.
const isMoveFailed = status === 'failed' && !!data?.error?.startsWith('move-failed')
const isConflict = status === 'failed' && !isMoveFailed && data?.error?.includes('412')
const isPersistent = status === 'failed' || status === 'dead'
// Invalidate events on done OR on conflict (D-06/D-08)
@@ -113,6 +118,16 @@ export function SyncStateToast() {
aria-hidden="true"
/>
)
} else if (isMoveFailed) {
// WR-06: the move could not be applied; the original event is unchanged.
copy = "Couldn't move the event. Open it and save again."
icon = (
<AlertCircle
size={14}
style={{ color: 'var(--color-destructive)', flexShrink: 0 }}
aria-hidden="true"
/>
)
} else if (status === 'failed') {
copy = "Didn't save. Try again."
icon = (