fix(backup): order the source aliases a deleted document's keys are read from

The backup export is totally ordered so two exports of the same account are
byte-identical; the alias relation the import-key ledger reads was the one
nested read without an order.
This commit is contained in:
Marc-André Bombeck committed 2026-10-25 03:02:56 +01:00
1 parent 2b27b4b501
commit 3853ce7f1a
1 file changed
+2
+2
View File
@@ -45,6 +45,8 @@ export const SOURCE_KEY_SELECT = {
sourceId: true,
sourceInstance: true,
sourceAliases: {
// The backup reads through this select, and its export is totally ordered.
orderBy: [{ createdAt: "asc" }, { id: "asc" }],
select: { sourceSystem: true, sourceId: true, sourceInstance: true },
},
} as const;