Commit e894a24
committed
Eighth-pass audit: fix silent send/profile errors, draft loss on failed send
Three bugs in the Swift shell + core:
1. ChatView never displayed core.view.error. Errors from send_text
("message too long", "contact list is full", "cannot send to a
blocked contact", "gave up sending N messages", "invalid key")
were set on model.error and rendered into view.error, but ChatView
had no error display. The user tapped send, it failed, and they
saw nothing. Now shows the error above the composer.
2. ChatView cleared the local draft unconditionally after sendText,
even when send_text refused the message (blocked, too long, cap
full). The core preserved model.compose on those paths, but the
Swift draft was already wiped -- the failure was both invisible
and destructive. Now only clears draft when core.view.error is
empty (i.e., the core accepted the message).
3. EditProfileView never displayed core.view.error. "display name too
long", "bio too long", "photo too large" were silently swallowed
when the user tapped Save. Now shows the error in a section.
Also in core: send_text and SaveProfile now clear model.error at the
top, so a stale error from a previous failed attempt does not persist
after the user fixes the issue and tries again. Previously the error
display would show the old error even after a successful send/save.
Test: send_text_clears_a_stale_error_on_success verifies the clearing.1 parent c24f528 commit e894a24
3 files changed
Lines changed: 71 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
161 | 170 | | |
162 | 171 | | |
163 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
335 | 360 | | |
336 | | - | |
337 | | - | |
338 | 361 | | |
339 | 362 | | |
340 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
| 962 | + | |
| 963 | + | |
962 | 964 | | |
963 | 965 | | |
964 | 966 | | |
| |||
1574 | 1576 | | |
1575 | 1577 | | |
1576 | 1578 | | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
1577 | 1582 | | |
1578 | 1583 | | |
1579 | 1584 | | |
| |||
4435 | 4440 | | |
4436 | 4441 | | |
4437 | 4442 | | |
| 4443 | + | |
| 4444 | + | |
| 4445 | + | |
| 4446 | + | |
| 4447 | + | |
| 4448 | + | |
| 4449 | + | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
| 4461 | + | |
4438 | 4462 | | |
4439 | 4463 | | |
4440 | 4464 | | |
| |||
0 commit comments