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 5f310c3
Browse filesBrowse the repository at this point in the historyBrowse files
feat(messaging,spec): store a push device's origin and carry it in every push
sys_user_device gains an optional, unbounded origin column. The device
registry stores the registration's origin on the row (null without one,
replaced by a refresh like app_id and locale) and listDevices answers it,
so the push channel's existing copy of device.origin into the push data
finally has a value to copy.
Spec retires the two [PLANNED — not yet stored] prefixes on
RegisterDeviceRequestSchema.origin and UserDeviceSchema.origin, flips the
marker pin, and the push server origin docblock names where its pattern
is knowingly narrower (underscore labels, trailing-dot hosts) and looser
(port digits, the IPv6 arm) than a URL origin, and that IPv4 is accepted.
Claude-Session: https://claude.ai/code/session_016WV4czbHcjvoBYWDw2gRAq
Co-authored-by: Claude <noreply@anthropic.com>
feat(messaging,spec): a push device's `origin` is stored at registration and every push to the device carries it back
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
-**`@objectstack/service-messaging`**: `sys_user_device` gains an optional `origin` column. `POST /api/v1/notifications/devices` stores the registration's `origin` on the device row (`null` when the registration names none, and a refresh replaces it as it does `appId` and `locale`); `listDevices` answers it; and the push channel, which already copied a device's `origin` into the push data, now finds one to copy. A mobile shell with several saved servers can therefore open a tapped push on the server that sent it. Registrations without `origin` behave exactly as before.
12
+
-**`@objectstack/spec`**: `RegisterDeviceRequestSchema.origin` and `UserDeviceSchema.origin` drop their `[PLANNED — not yet stored]` prefix, since the server now stores the value. The push server origin docblock names where its pattern is knowingly narrower than a URL origin (an underscore in a label, a trailing-dot host) and looser (a written-out default port, a leading zero or an out-of-range port, any bracketed run of hex digits, colons and dots), and that a dotted IPv4 host is accepted. Description and docblock text only; nothing a caller sends is accepted or refused differently.
Copy file name to clipboardExpand all lines: content/docs/references/api/protocol.mdx
+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
@@ -2782,7 +2782,7 @@ Register or refresh a push device for the signed-in user
2782
2782
|**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 |
2783
2783
|**appId**|`string`| optional | App the token was issued to: the iOS bundle ID or the Android application ID |
2784
2784
|**locale**|`string`| optional | Device locale (BCP 47, for example zh-CN). Stored on the device row; no push renders by it: a push arrives in the recipient's language (sys_user.locale, then the deployment default) |
2785
-
|**origin**|`string`| optional |[PLANNED — not yet stored]The origin the Console was loaded from (window.location.origin, for example https://crm.example.com): the address the mobile shell saved for this server. The Console writes it; the server stores it on the device row and every push to the device carries it back, so a shell with several saved servers opens the push on the one that sent it. http or https, a lowercase host and an optional port; a path, another scheme or a bare host is refused |
2785
+
|**origin**|`string`| optional | The origin the Console was loaded from (window.location.origin, for example https://crm.example.com): the address the mobile shell saved for this server. The Console writes it; the server stores it on the device row and every push to the device carries it back, so a shell with several saved servers opens the push on the one that sent it. http or https, a lowercase host and an optional port; a path, another scheme or a bare host is refused |
Copy file name to clipboardExpand all lines: content/docs/references/system/push-device.mdx
+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
@@ -38,7 +38,7 @@ A push device of one user: one row per app install
38
38
|**appId**|`string`| optional | App the token was issued to: the iOS bundle ID or the Android application ID |
39
39
|**locale**|`string`| optional | Device locale (BCP 47, for example zh-CN), as the registration named it. Stored for the device; no push renders by it: a push arrives in the recipient's language (sys_user.locale, then the deployment default) |
40
40
|**name**|`string`| optional | Device friendly name, as the registration named it |
41
-
|**origin**|`string`| optional |[PLANNED — not yet stored]The origin the Console was loaded from, as the registration named it (for example https://crm.example.com). The device registry keeps it on the row and the push channel copies it into every push to this device, where the mobile shell picks the saved server by it. Absent on a device registered without one |
41
+
|**origin**|`string`| optional | The origin the Console was loaded from, as the registration named it (for example https://crm.example.com). The device registry keeps it on the row and the push channel copies it into every push to this device, where the mobile shell picks the saved server by it. Absent on a device registered without one |
42
42
|**enabled**|`boolean`| ✅ | False once the vendor reported the token dead; nothing is delivered to a disabled device |
43
43
|**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 |
44
44
|**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