fix(housekeeping): restore people partial compatibility

This commit is contained in:
Simo committed 2026-08-29 21:03:43 +02:00
1 parent fcd1dfd96e
commit a6a288d9ff
6 files changed
+412 -11

No files matched your search

+60
View File
@@ -91,4 +91,64 @@ describe("legacy bulk user wrappers", () => {
{ userId: 9, untilUnix: 1234 },
);
});
it.each([
[
"currency",
"users.bulk-currency",
() => bulkGiveCurrency({ userIds: [7], amount: 100, type: "credits" }),
],
[
"badge",
"users.bulk-badge",
() => bulkGiveBadge({ userIds: [7], badgeCode: "ADM" }),
],
] as const)(
"restores the pre-Task12 legacy result when %s RCON throws after the database commit",
async (_kind, operation, invoke) => {
execute.mockResolvedValueOnce({
ok: true,
data: {
before: { completed: 0, total: 1, failedIds: [] },
after: {
completed: 1,
total: 1,
failedIds: [],
externalSyncFailures: [
{
userId: 7,
reason:
"Database applied; emulator sync failed. Do not retry automatically.",
},
],
},
completion: {
status: "partial",
external: "failed",
audit: "persisted",
},
},
correlationId: "legacy-external-sync-failure",
completion: {
status: "partial",
external: "failed",
audit: "persisted",
},
});
await expect(invoke()).resolves.toEqual({
ok: true,
data: {
given: 0,
total: 1,
failedIds: [{ userId: 7, reason: "Database error" }],
},
});
expect(execute).toHaveBeenCalledWith(
expect.anything(),
operation,
expect.anything(),
);
},
);
});