A task sent to the caller's archived inbox must land in the caller's
active inbox, never in a more recent inbox of another account.
Refs #145
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list create with isInbox: true moved the tasks of the active inbox into
the new id before inserting it. sl_tasks.list_id -> sl_lists.id is not
deferrable, so the operation was skipped as soon as the old inbox held a
task, typically on the first sync of a second device.
The transaction now inserts the new inbox first, then merges every other
active inbox of the account into it. An insert that creates nothing (an id
already in the caller's account, such as an inbox pushed back by
initialMerge) merges nothing. Only one new inbox is created per POST; the
next one is skipped with "Only one new inbox per request". Task create and
update send a task aimed at an archived inbox to the active one.
REVIEW.md (Sync) states the exact rule.
Refs #145
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>