Repository navigation
fix(platform): make Inbox assignment, selection and activity reliable - #3784
Merged
Merged
Conversation
The assignment doors read a body that failed to parse as `{}`, and an
absent field as "unassign": a truncated request answered 200 and took the
conversation away from its person (#3708). The Inbox's own Unassign and
Remove team send `null`, which the doors refused, so an admin could not
clear an assignment at all (#3732).
Each door now takes one required field, the id or `null` (the clear the
REST door's `teamId: null` already documents), and reads its body through
the app door's JSON reader: a truncated or empty body answers 400
`INVALID_JSON`, `{}` answers 400 naming the field, and the assignment is
left as it was. The adapter sends `null` only when the caller asked for
the clear and refuses a missing target before any request; the picker
passes `null` for every clear.
Tests: the doors behind the app JSON reader, the real adapters through
the real routes, the picker's clears, and a `checkConversations` lane on
real Postgres (a clear keeps the other dimension; the refused bodies
change nothing).
Every writer rewrites a conversation's unread count, status stamps and activity time from a read of the row. Two appends that read the same unlocked snapshot both committed and the later write won: one unread message instead of two, and the older message's time (#3735). The send lane, undo, discard, mark as read, the PATCH door and the bulk verbs had the same read, so a message landing beside any of them could lose its count. Each of them now reads the row FOR UPDATE in the transaction that writes it back, as the API mirror lane already did, and the one monotonic `nextConversationLastMessageAt` rule stays the only place activity time is decided. Tests: the statement shape of every writer, and two overlaps on real Postgres in `checkConversations`: an append held before its UPDATE beside one through the native door, and mark as read beside an append.
A list read whose retries gave up rendered the status's empty state, so an operator read "No conversations" while the server had answered nothing (#3709). The Home panel's Inbox view and the phone list now show "Couldn't load conversations" with Try again in its place; loaded rows stay on screen. Retry re-issues the request that failed: a refetch reloaded only the pages already there, so a page that failed after them was never asked for again. The new strings ship in EN, DE and FR.
The toolbar's Select all coerced the selection hook's "indeterminate" to checked, so one ticked row read as all of them and the next click cleared it (#3734). It now passes the three states through, as the phone list does, and ticking the mixed box selects the rest. A row's checkbox sat under the row link, which is lifted above the sliding highlight, so a click or tap on it opened the conversation and a selection could only start from the keyboard (CONV-F28). It now takes the link's lift and comes after it, still under the sticky group heading.
A selection of 201 conversations went out as one request, which the bulk door refuses above 200, so nothing changed (#3733). The five status verbs now send the selection in consecutive requests of at most `BULK_CONVERSATION_LIMIT`, the constant the door validates with. The busy state holds until the last request settles, and a selection over one request is counted off. One toast states the whole outcome with a refused request counted as failed, and the rows a refused request named stay selected so the verb can be retried on exactly those. The progress string ships in EN, DE and FR.
The Home docs say how the select-all box reads, that a large selection goes out in parts and what happens to the rows that fail, what a list that did not load shows, and how Owners and Admins clear a person or a team. The manual suite gains CONV-F34 (bulk verbs over more than one request) and CONV-B7 (a list that does not load), and the automation register names the specs that own each half.
yannickmonney
force-pushed
the
fix/inbox-assignment-selection-activity
branch
from
September 29, 2026 00:13
1b29e32 to
151d628
Compare
Contributor
Author
|
Rebased onto The first head failed only the Browser job, on After the rebase I re-ran locally the conversation and Home suites (63 files), the Home browser file in Chromium (25/25, twice), the |
This was referenced Sep 29, 2026
yannickmonney
added a commit
that referenced
this pull request
Sep 29, 2026
A failed `useBackendMutation` / `useBackendAction` raises its own destructive toast unless the call passes `errorToast: false`, and 182 callers on main reported the same failure again: their catch, `.catch` or `onError` toast, a batch summary toast, `EditorActions` for a rejected editor `save`, the bulk bars or `EntityDeleteDialog` for a rejected callback, or a query retrying the write. The guard parses every app source file with the TypeScript compiler, indexes each write that toasts on failure (a direct call, a hook returning one, resolving option-forwarding hooks by their call-site argument, a hook returning a function that rethrows one, and a hook an adapter object names), and follows each invocation's rejection through awaits, returns, rethrowing catches, local functions and their callers to the place that reports it. It fails on a second toast, naming the write and the caller. Five pairs stay allowlisted with #3784, which fixes its bulk verbs; the entries turn stale when it lands. `.agents/repo.md` states the rule.
…selection-activity # Conflicts: # services/platform/app/features/conversations/components/conversation-assignee-picker.test.tsx # services/platform/app/features/conversations/components/conversation-assignee-picker.tsx # services/platform/tests/manual/suites/conversations.md
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six Inbox defects reported from the local audit, one commit each (TALE-88). Each fix comes with its own regression tests. The fixes reuse the boundaries they share: one assignment wire contract, one bulk limit constant, one list error state, and one rule for how a conversation's summary is written.
What changed
Assignment doors:
nullclears, and a broken body clears nothing (#3708, #3732)POST /api/app/conversations/:id/assignand…/assign-teamread a body that failed to parse as{}, and read a missing field as "unassign". A truncated body therefore answered 200 and removed the person (Bug: Inbox assignment silently unassigns a conversation when the JSON body is malformed #3708).{"assigneeUserId": null}, which the doors refused with a 400 (bug(platform): Inbox Unassign sends null that the assignment API rejects #3732). Since the Postgres move, the Inbox had no working way to clear an assignment.null.nullis the clear gesture the REST door'steamId: nullalready documents. The body goes through the app door's JSON reader:INVALID_JSON;{}answers 400 naming the field;nullonly for an explicit clear, and refuses a missing target before sending anything. The picker passesnullfor each clear.A conversation's summary is written under its row lock (#3735)
addMessageToConversationread the parent row without a lock and wrote back the unread count and activity time it had computed from that read. Two overlapping appends both committed, and the later write left one unread message and the older timestamp.FOR UPDATEinside the transaction that writes it back, as the API mirror lane already did.nextConversationLastMessageAtremains the only place the activity time is computed; no second copy of it in SQL.A failed list read says so (#3709)
retryfromuseCachedPaginatedQuerynow re-issues the request that actually failed. It used to callrefetch, which reloads only the pages already loaded, so a later page that failed was never requested again.Select all reads three states (#3734)
'indeterminate'intotrue. One ticked row showed as "all selected", and the next click cleared that row instead of selecting the rest.z-10above the sliding highlight.elementFromPointconfirmed it in Chromium: a mouse click or tap on the checkbox opened the conversation. A selection could only start from the keyboard, which contradicts CONV-F28 and the Home docs. The checkbox now takes the same lift and sits after the link, while still passing under the sticky group heading.Bulk verbs go out in batches the door accepts (#3733)
BULK_CONVERSATION_LIMIT. This is the same constant the door validates against, inlib/shared.Docs and manual layer
docs/{en,de,fr}/platform/index.mdnow covers select all, batches, the failed-load state, and how Owners and Admins clear a person or a team.CONV-F34(bulk verbs over more than one request) andCONV-B7(a list that does not load); a clause added toCONV-F28.reference/automation.mdnaming the specs that own each automated part.How I verified it
All six were reproduced on
origin/mainbefore any code changed. They were verified again after the fix through native routes and the real UI: a local stack running the real backend withROLE=api(no worker, so no sends and no agent runs), Vite, a scratch Postgres 16, and Chromium.{}→ 200, clearedINVALID_JSON;{}→ 400assigneeUserId: is required; DB unchanged{"assigneeUserId":null}→ 400; person keptaria-checked="true", a click cleared itmixed→ click selects all loaded rows (30) → click again clears; a mouse click on a row's checkbox selects it and does not navigateChecks run:
backend:integrationlanecheckConversations(real PG 16, run locally; this lane is not a CI job). It gains three checks:null, and bodies that name no target change nothing;With main's
routes.ts/service.ts/send.tsall three FAIL, with exactly the reported symptoms. With this branch: 24/25 pass. The one failure is the BM25 boot check, which needspg_searchand fails the same way on main.Unit and component tests. Every new test was also run against main's version of its source and fails there:
routes.test.ts: 10 of the 18 new cases fail on main. The other 8 are controls: valid ids, typed refusals, and the cap that already existed.conversations.wire.test.ts(the real adapters through the real routes): 4/6 fail on main.service.summary-lock.test.ts+send.test.tslock cases: 7/7 fail on main.use-cached-paginated-query.test.tsx: 1/3 fail on main.home-inbox-list.test.tsx: 4 of the 6 new select-all and read-failure cases fail on main. The other 2 are controls: each row ticked by hand, and loaded rows kept.use-bulk-actions.test.ts: all 12 new status-verb cases fail on main.home-inbox-list.wire.test.tsx(the real list, selection and bulk hooks down tofetch): 5/6 fail on main.home-panel.browser.test.tsxreal-pointer case (Chromium): 2/2 fail on main.vitest relatedover every changed source file on the final branch (server + client projects), 487 files. In one loaded run, 481 passed and 6 unrelated settings/tasks files hit the 5 s client timeout; run on their own, those 6 pass (137/137). The changed UI tests also pass undervitest.ui.config.ts, and the browser project file passes in Chromium.oxlint --type-awareon the changed files; scopedtsc --noEmit;oxfmt --check;bun run lint:manual;check-guide.tsonconversations.md; the docs suite (services/docs, 35 files);lib/i18n/messages.test.ts. All clean.visual-aspect-analyzeron three changed states (Home Inbox with one row ticked, Home Inbox after a failed read, phone list after a failed read). Main and this branch report the same page-load layout shifts in the view switcher, score 99 on both. No defect is attributable to this change. It does not reach 100 because of that existing shift.Screenshots (before/after for each issue, the failed-load state in DE and FR, and phone progress) and the probe outputs are attached to the TALE-88 task.
Notes for review
{}(the adapter has sentnullsince the Postgres move), so no caller is broken. An old SPA bundle still sendsnull, which now works.FOR UPDATEfollows the house convention (api-sync.tslocks the same parent). The bulk verb locks rows in the order the client sends them, the same order its UPDATEs already locked them in, so this adds no new deadlock risk.docs/*/platform/index.md; fix(ai): stagger gateway token refreshes and resume runs they cut #3742, fix(platform): close the task-limits review round after #3689 #3749, fix(platform): stop promising skills and images the product does not have #3770, fix(platform): preserve recurring task work and series #3771 edit the message catalogs; fix(ai): stagger gateway token refreshes and resume runs they cut #3742, fix(platform): close the task-limits review round after #3689 #3749, fix(platform): preserve recurring task work and series #3771, fix(platform): scope automation runs to the projects the viewer can see #3772, fix(platform): keep custom provider edits whole and version-checked #3778 editintegration-check.tsand/orreference/automation.md. Expect textual conflicts only.Closes #3708
Closes #3709
Closes #3732
Closes #3733
Closes #3734
Closes #3735