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 eb9b237
Browse filesBrowse the repository at this point in the historyBrowse files
fix(spec): push route is the inbox actionUrl the shell resolves; path refusals
Delta contract review round 3 on the push device registry spec.
- PushDeliveryData.route is the notification's actionUrl, the same value
the inbox serves: app-relative (/OBJECT/ID) or already /apps/... The
describes and the docblock say the shell resolves it on tap exactly as
the bell and Home do (resolveNotificationTarget with its host app
segment) and never navigates it verbatim.
- The docblock says where the data sits per vendor: FCM message.data,
APNs top level beside aps, never under a data key.
- PushRouteSchema refuses dot segments and percent-encoded /, \ and . in
its path, as a pattern the published JSON Schema carries too.
- The device docblock and registerDevice say a token the user already
holds under another deviceId refreshes that row, never a second live
row.
- The changeset follows.
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
+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
@@ -10,7 +10,7 @@ Metadata-protocol: added
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
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
-
-**`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`.
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 row (the same user's registration without a `deviceId` refreshes the row that holds it, and 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
-
-**`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.
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; no dot segment and no percent-encoded `/`, `\` or `.` in its path). The route is derived, never authored: it is the notification's existing `actionUrl`(app-relative `/OBJECT/ID` or an `/apps/…` route) when that passes the schema, and absent otherwise. The shell resolves it on tap as the inbox does, never verbatim. FCM carries this data in `message.data`; APNs at the top level of the payload, beside `aps`. No `notify` key is added.
16
16
-**`PushServiceConfigSchema`** (new, `system/push-config.zod.ts`, beside the email transport configuration): an `apns` block (token auth: `teamId`, `keyId`, `topic`, `environment: sandbox | production`, the `.p8` key by `credentialRef`) and an `fcm` block (HTTP v1: `projectId`, the service-account JSON by `credentialRef`). Secrets are references only (ADR-0143 D3). An inline secret is refused by name under the keys an operator would reach for, and refused as the content of a reference (a PEM block or a JSON document). `PushVendorSchema` names the two vendors. It is not a stack-definition key until its reader ships.
with its host app segment, which hosts an app-relative path under
41
+
`/apps/APP/` and passes an `/apps/…` route through. One resolver, so a
42
+
push and the inbox row open the same screen.
29
43
30
44
Not to be confused with the `PushNotificationSchema` that `system/` once
31
45
declared and then removed (ADR-0049): that was an authoring template shape;
@@ -49,23 +63,21 @@ const result = PushDeliveryDataSchema.parse(data);
49
63
50
64
## PushDeliveryData
51
65
52
-
[PLANNED — not yet served] The data a push delivery carries to the shell: the notification id and the same-server route opened on tap. No push channel delivers yet
66
+
[PLANNED — not yet served] The data a push delivery carries to the shell: the notification id and its actionUrl as a same-server route. No push channel delivers yet
53
67
54
68
### Properties
55
69
56
70
| Property | Type | Required | Description |
57
71
| :--- | :--- | :--- | :--- |
58
72
|**notificationId**|`string`| ✅ | Notification id — the one the inbox lists and markRead takes |
59
-
|**route**|`string`| optional |Console route opened on tap: the notification actionUrl when it is a same-server relative path, absent otherwise |
73
+
|**route**|`string`| optional |The notification actionUrl, the value the inbox serves, when it is a same-server relative path; absent otherwise. The shell resolves it on tap as the inbox bell and Home do, never verbatim|
60
74
61
75
62
76
---
63
77
64
78
## PushRoute
65
79
66
-
Same-server relative path the shell opens on tap (for example /apps/crm/opportunity/123); never an absolute or off-server URL
67
-
68
-
**Type:**`string`
80
+
The notification actionUrl as a same-server relative path: app-relative (/opportunity/123) or a Console route (/apps/crm/opportunity/123). The shell resolves it on tap as the inbox does, never verbatim; never an absolute or off-server URL
0 commit comments