Files
bambuddy/backend
maziggy 03b2ce5c16 fix(backup): say when a restored archive lands without an owner (#2656)
`created_by_id` is not attribution, it is the column the access check runs
    on: `_ensure_archive_visible` fails closed on NULL, so an ownerless archive
    is a 404 for every caller without `archives:read_all` and never appears in
    the ownership-scoped list queries.

    On the overwrite path an absent key correctly leaves the local owner alone
    — that rule is deliberate and unchanged. On the insert path there is no
    local row to fall back on, so the archive lands ownerless, and nothing said
    so. The restore reported N archives restored while the user who asked for
    them saw none. Two ways in, both silent: a commit taken before the
    collector recorded the column (every pre-#2656 backup), and an archive that
    genuinely had no owner on the source instance.

    Adds `archivesOwnerUnknown`, emitted on insert only, and suppressed when
    the stale-id branch has already spoken for that row so one cause does not
    produce two notes. Wording mirrors `archivesOwnerCleared` because the
    consequence and the remedy are the same; the cause is not, so it is a
    separate code rather than a reuse.

    Five tests, plus the existing `test_a_backup_without_the_key_still_restores`
    renamed and tightened — it asserted the silence this fixes. 13 locales back
    in parity at 5772 leaves. No modal change: notes render through
    `translateCoded`, which resolves by code.
2026-08-15 14:17:21 +02:00
..