1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

chore: prevent duplicate key errors in unknown flags (#9940)

https://linear.app/unleash/issue/2-3561/fix-duplicate-key-errors-in-unknown-flags

This should prevent `duplicate_key` errors in unknown flags.

Follow-up to: https://github.com/Unleash/unleash/pull/9837

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Nuno Góis 2025-05-09 10:02:38 +01:00 committed by GitHub
parent 8b115122fc
commit bfc583b5b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,7 +33,10 @@ export class UnknownFlagsStore implements IUnknownFlagsStore {
app_name: flag.appName,
seen_at: flag.seenAt,
}));
await tx(TABLE).insert(rows);
await tx(TABLE)
.insert(rows)
.onConflict(['name', 'app_name'])
.merge(['seen_at']);
}
});
}