Files
bambuddy/backend
maziggy ca6b9f8fe0 fix(backup): resolve a restored archive's owner by username, not by id (#2656)
created_by_id is only meaningful on the instance that wrote it. Restoring
    onto a rebuilt instance - this feature's main use case - renumbers the
    users table, so a live id can land on a different person and hand one
    user's print history to another under archives:read_own. The id path
    cannot even detect that: archivesOwnerCleared fires only for an id that
    is absent, so a valid-but-wrong id produced no note at all.

    The collector now records created_by_username alongside the id, and the
    restore prefers it. username is unique on users, so a match is the same
    person; the one case it cannot resolve - a user renamed since the backup
    - falls through to ownerless with a note rather than guessing from the
    id. The id stays as the fallback for backups taken before this change.
2026-08-15 14:25:16 +02:00
..