Repository navigation
Commit 0efab4c
committed
fix(web): an edit saved during dispatch no longer disappears (#40 A5)
The drain consults the editing hold only when it PICKS a head
(`useThreadOutboxDrain.ts` — the `editingQueuedMessageIds` check sits in the
selection loop, above `beginDispatchingQueuedMessage`). A hold taken after
that point does not stop the send already under way, and
`threadOutboxManager.update` correctly returns `false` for a message that has
left the queue — but `saveEditing` ignored the return and closed the editor as
if it had saved. Net effect: the message went out with its ORIGINAL text, the
user's revision was gone from the queue, the editor, and the composer, and
nothing anywhere said so.
Closed from both sides:
* `beginEditing` refuses to open the editor for the row currently being
dispatched. Selection and `beginDispatchingQueuedMessage` are synchronous
within the same effect, so the atom covers the whole async send with no gap.
* `saveEditing` honours the boolean. On `false` it logs through the module's
own `[thread-outbox]` breadcrumb helper and raises a warning toast saying the
message already went out with its original text. The row unmounts either way
— it renders from the queue — so the news has to leave the component.
`logOutboxMutationFailure` gains `"update"` beside `"reorder"`; a no-op update
is exactly as invisible to the user as a rejected reorder, which is what that
helper already exists for.
Both changed files are fork-owned; the upstream-owned file count and every
deletion count are unchanged.
Verified: `vp test run apps/web/src/outbox` 41 passed; `vp lint` clean;
`tsgo --noEmit -p apps/web` 0 errors. Not unit-tested at the component level —
apps/web has 34 component tests and every one is `renderToStaticMarkup`, so
there is no way to drive a click here without adding an interaction-test
dependency. The contract this leans on (`update` resolving `false` once the
message has left the queue) is already pinned by
threadOutbox.logic.test.ts:442.1 parent 70e7b05 commit 0efab4c
2 files changed
Lines changed: 52 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
104 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
105 | 126 | | |
106 | 127 | | |
107 | 128 | | |
108 | | - | |
| 129 | + | |
109 | 130 | | |
110 | 131 | | |
111 | 132 | | |
| |||
121 | 142 | | |
122 | 143 | | |
123 | 144 | | |
124 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
125 | 167 | | |
126 | 168 | | |
127 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | | - | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
0 commit comments