You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e7b06bc
Browse filesBrowse the repository at this point in the historyBrowse files
- RegisterDeviceRequestSchema.vendor and INotificationService.registerDevice
now say the same thing: web has no default vendor, a web registration
names apns or fcm, and one without vendor is refused.
- unregisterDevice states its mechanism: a device the user does not hold
throws an error whose code is NOT_FOUND, which the route answers as 404.
- A comment says why the push secretReference is stricter than the house
credentialRef: the two push secrets are recognisable by shape (PEM block,
JSON document), a bearer token or API key is not.
- One platform list for the registration and the stored device, in an
internal module no barrel re-exports, so no new public name.
- UserDeviceSchema describes say when lastSeenAt and invalidatedAt are absent.
- The changeset names LocaleSchema for the registration's locale.
Claude-Session: https://claude.ai/code/session_01ADHkmT6K7dHh79Lej3sWr5
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/29067-push-device-registry-spec.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Metadata-protocol: added
9
9
10
10
Nothing here is served or read yet. Every new or touched schema carries a `[PLANNED — not yet served]` or `[PLANNED — not yet read]` marker in its description, and no route row is added: the device routes land in `DEFAULT_NOTIFICATION_ROUTES` together with their handlers, so the catalog never advertises a route that answers 404. Nothing a client or an operator writes today is refused.
11
11
12
-
-**`RegisterDeviceRequestSchema`** gains three optional members: `vendor` (`apns` | `fcm`; absent, the server derives it from `platform`, `ios` → `apns` and `android` → `fcm`, and a `web` registration names its vendor), `appId` and `locale`. `token`, `platform`, `deviceId` and `name` are unchanged, so every body a client sent before still parses as it did. The describes now say that re-registering a `deviceId` refreshes that device, and that a request without one gets a server-minted id the client keeps. A `vendor` outside `apns` / `fcm` is refused; since the member is new, no body sent before carries one. `RegisterDeviceResponseSchema` and `UnregisterDevice*` keep their members and gain only their description.
12
+
-**`RegisterDeviceRequestSchema`** gains three optional members: `vendor` (`apns` | `fcm`; absent, the server derives it from `platform`, `ios` → `apns` and `android` → `fcm`, and a `web` registration names `apns` or `fcm`), `appId` and `locale` (a BCP 47 tag, the house `LocaleSchema`). `token`, `platform`, `deviceId` and `name` are unchanged, so every body a client sent before still parses as it did. The describes now say that re-registering a `deviceId` refreshes that device, and that a request without one gets a server-minted id the client keeps. A `vendor` outside `apns` / `fcm` is refused; since the member is new, no body sent before carries one. `RegisterDeviceResponseSchema` and `UnregisterDevice*` keep their members and gain only their description.
13
13
-**`UserDeviceSchema`** (new, `system/push-device.zod.ts`) is the stored device: `deviceId`, `userId`, `vendor`, `token`, `platform`, `enabled`, and optional `appId`, `locale`, `name`, `invalidatedAt` and `lastSeenAt`. A device belongs to its user alone (no organization member), a token has one live owner (a second user's registration takes it over), and a token the vendor reports dead keeps its row with `enabled: false` and `invalidatedAt`.
14
14
-**`INotificationService`** gains four optional members: `registerDevice(userId, request)`, `unregisterDevice(userId, deviceId)`, `listDevices(userId)` and `invalidateDeviceToken(token)`. Their docs state the semantics an implementation owes. Absence means the capability is unavailable, so every existing implementation stays valid.
15
15
-**`PushDeliveryDataSchema`** (new, `api/push-delivery.zod.ts`) is the data a push carries to the shell: `notificationId` and an optional `route`. `PushRouteSchema` admits only a same-server relative path (one leading `/`; no scheme, host, backslash, whitespace or control character). The route is derived, never authored: it is the notification's existing `actionUrl` when that passes the schema, and absent otherwise. No `notify` key is added.
|**deviceId**|`string`| optional | Client-held device id, stable per app install. Re-registering the same deviceId refreshes that device; absent, the server mints one and answers it, and the client keeps it for later registrations and unregister |
2773
2773
|**name**|`string`| optional | Device friendly name |
2774
-
|**vendor**|`Enum<'apns' \| 'fcm'>`| optional | Push vendor the token belongs to: apns or fcm. Absent, the server derives it from platform: ios means apns, android means fcm; web has no core vendor, so a web registration names fcm or is refused |
2774
+
|**vendor**|`Enum<'apns' \| 'fcm'>`| optional | Push vendor the token belongs to: apns or fcm. Absent, the server derives it from platform: ios means apns, android means fcm. web has no default vendor: a web registration names apns or fcm, and one without vendor is refused |
2775
2775
|**appId**|`string`| optional | App the token was issued to: the iOS bundle ID or the Android application ID |
2776
2776
|**locale**|`string`| optional | Device locale (BCP 47, for example zh-CN) that pushes to this device are rendered in |
Copy file name to clipboardExpand all lines: content/docs/references/system/push-device.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,8 +75,8 @@ const result = UserDeviceSchema.parse(data);
75
75
|**locale**|`string`| optional | Device locale (BCP 47, for example zh-CN) that pushes to this device are rendered in |
76
76
|**name**|`string`| optional | Device friendly name, as the registration named it |
77
77
|**enabled**|`boolean`| ✅ | False once the vendor reported the token dead; nothing is delivered to a disabled device |
78
-
|**invalidatedAt**|`string`| optional | When the vendor reported the token dead; absent while the device is enabled |
79
-
|**lastSeenAt**|`string`| optional | When the device last registered or refreshed |
78
+
|**invalidatedAt**|`string`| optional | When the vendor reported the token dead. Present exactly while enabled is false: absent on an enabled device, and cleared by the registration that re-enables it|
79
+
|**lastSeenAt**|`string`| optional | When the device last registered or refreshed. Every registration and refresh sets it, so it is absent only on a row no registration wrote; listDevices answers such a device last|
0 commit comments