Commit 8010ce3
feat: unarchive message thread on new inbound message (per-phone setting) (#954)
* feat(api): add UnarchiveThread setting to Phone entity
* feat(api): add UnarchiveThread to MessagePhoneReceivedPayload
* feat(api): populate UnarchiveThread from phone on received event
* feat(api): unarchive thread on inbound message when enabled
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat(api): forward UnarchiveThread flag from received event to thread update
* feat(api): accept unarchive_thread in phone upsert request
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore(web): regenerate api models with unarchive_thread
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* feat(web): send unarchive_thread in updatePhone
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* feat(web): add per-phone unarchive-thread toggle to settings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* test(integration): verify unarchive thread on receive
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* feat: fix english
* feat: fix english
* fix: address PR review comments on unarchive-thread
- URL-escape the E.164 owner in the message-threads query (+ decodes to space)
- Use native stacktrace.Propagate printf args (avoids go vet non-constant format warning)
- Document why setUnarchiveThread must send the required sim field
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* perf: load unarchive flag lazily for archived threads
Consult the phone's UnarchiveThread setting inside
MessageThreadService.UpdateThread only when an inbound message lands on
an archived thread, instead of loading the phone on every received
message. Removes the per-message phone read in ReceiveMessage and drops
the UnarchiveThread field from the received-message event payload.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* test: retry inbound receive while phone api key associates
The phone-to-API-key association runs asynchronously via the
phone_api_key event listener, so a freshly provisioned phone can return
401 on receive until the auth cache clears. Retry receiveInbound on that
transient 401 instead of failing immediately.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
* test: cover not-archived non-received unarchive branch
Remove an unrelated webhook email payload formatting plan doc that was
accidentally included in this feature branch, and add the missing
shouldCheckUnarchive case for a non-archived thread with a non-received
status so every branch of the predicate is exercised.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bf78429e-573c-406c-9f7c-1d6e1bddbbb5
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent f03d163 commit 8010ce3
19 files changed
Lines changed: 563 additions & 10 deletions
File tree
- api
- docs
- pkg
- di
- entities
- handlers
- requests
- services
- docs/superpowers/specs
- tests
- web
- app
- pages/settings
- stores
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3379 | 3379 | | |
3380 | 3380 | | |
3381 | 3381 | | |
3382 | | - | |
| 3382 | + | |
3383 | 3383 | | |
3384 | 3384 | | |
3385 | 3385 | | |
| |||
3760 | 3760 | | |
3761 | 3761 | | |
3762 | 3762 | | |
| 3763 | + | |
3763 | 3764 | | |
3764 | 3765 | | |
3765 | 3766 | | |
| |||
3804 | 3805 | | |
3805 | 3806 | | |
3806 | 3807 | | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
3807 | 3813 | | |
3808 | 3814 | | |
3809 | 3815 | | |
| |||
4436 | 4442 | | |
4437 | 4443 | | |
4438 | 4444 | | |
4439 | | - | |
| 4445 | + | |
| 4446 | + | |
4440 | 4447 | | |
4441 | 4448 | | |
4442 | 4449 | | |
| |||
4473 | 4480 | | |
4474 | 4481 | | |
4475 | 4482 | | |
| 4483 | + | |
| 4484 | + | |
| 4485 | + | |
| 4486 | + | |
| 4487 | + | |
4476 | 4488 | | |
4477 | 4489 | | |
4478 | 4490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3376 | 3376 | | |
3377 | 3377 | | |
3378 | 3378 | | |
3379 | | - | |
| 3379 | + | |
3380 | 3380 | | |
3381 | 3381 | | |
3382 | 3382 | | |
| |||
3757 | 3757 | | |
3758 | 3758 | | |
3759 | 3759 | | |
| 3760 | + | |
3760 | 3761 | | |
3761 | 3762 | | |
3762 | 3763 | | |
| |||
3801 | 3802 | | |
3802 | 3803 | | |
3803 | 3804 | | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
3804 | 3810 | | |
3805 | 3811 | | |
3806 | 3812 | | |
| |||
4433 | 4439 | | |
4434 | 4440 | | |
4435 | 4441 | | |
4436 | | - | |
| 4442 | + | |
| 4443 | + | |
4437 | 4444 | | |
4438 | 4445 | | |
4439 | 4446 | | |
| |||
4470 | 4477 | | |
4471 | 4478 | | |
4472 | 4479 | | |
| 4480 | + | |
| 4481 | + | |
| 4482 | + | |
| 4483 | + | |
| 4484 | + | |
4473 | 4485 | | |
4474 | 4486 | | |
4475 | 4487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
| |||
402 | 407 | | |
403 | 408 | | |
404 | 409 | | |
| 410 | + | |
405 | 411 | | |
406 | 412 | | |
407 | 413 | | |
| |||
908 | 914 | | |
909 | 915 | | |
910 | 916 | | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
911 | 922 | | |
912 | 923 | | |
913 | 924 | | |
| |||
916 | 927 | | |
917 | 928 | | |
918 | 929 | | |
| 930 | + | |
919 | 931 | | |
920 | 932 | | |
921 | 933 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
1114 | 1115 | | |
1115 | 1116 | | |
1116 | 1117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| |||
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| 103 | + | |
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
349 | 351 | | |
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
353 | | - | |
| 355 | + | |
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
| |||
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
95 | 116 | | |
96 | 117 | | |
97 | 118 | | |
| |||
0 commit comments