feat(register): key devices by deviceId and replace FCM tokens in place
Require deviceId on POST /notifications/register, upsert by deviceId while preserving lastNotifiedAt and internal id, prune duplicate token rows, migrate legacy fcmToken-keyed JSON, and add register logs. Extend StoredRow and Device with deviceId; resolve pushes by scanning fcmToken.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
export interface Device {
|
||||
/** Internal row id used for persistence updates. */
|
||||
id: string;
|
||||
pushToken: string;
|
||||
/** Client-provided stable physical device identity. */
|
||||
deviceId: string;
|
||||
fcmToken: string;
|
||||
platform: "ios" | "android" | "web";
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
|
||||
Reference in New Issue
Block a user