@protobase/cli 0.95.8 → 0.95.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.10",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.95.
|
|
47
|
-
"@protobase/layout": "0.95.
|
|
48
|
-
"@protobase/query": "0.95.
|
|
49
|
-
"@protobase/schema": "0.95.
|
|
50
|
-
"@protobase/server": "0.95.
|
|
51
|
-
"@protobase/ui": "0.95.
|
|
52
|
-
"@protobase/workflows": "0.95.
|
|
46
|
+
"@protobase/config": "0.95.10",
|
|
47
|
+
"@protobase/layout": "0.95.10",
|
|
48
|
+
"@protobase/query": "0.95.10",
|
|
49
|
+
"@protobase/schema": "0.95.10",
|
|
50
|
+
"@protobase/server": "0.95.10",
|
|
51
|
+
"@protobase/ui": "0.95.10",
|
|
52
|
+
"@protobase/workflows": "0.95.10",
|
|
53
53
|
"@react-email/render": "^2.1.0",
|
|
54
54
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
55
55
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -53,6 +53,8 @@ A change is what an event sees: one per record and transaction, with the record
|
|
|
53
53
|
| Who | For a write through the API, the caller's id and roles. For a write from elsewhere, none; the database role that wrote is kept either way: the one `set role` chose, else the session's. |
|
|
54
54
|
| `at` | When the writing transaction started. |
|
|
55
55
|
|
|
56
|
+
<gap>A change cannot show a relation of several columns in `before`, `after` or `changed` because reading its captured key columns back into the field is not implemented.</gap>
|
|
57
|
+
|
|
56
58
|
## Ignoring fields
|
|
57
59
|
|
|
58
60
|
`.history({ ignore: [...] })` names fields whose changes are not captured at all, such as counts or timestamps the database keeps up to date itself. An update that changes only those fields keeps nothing, and queues no work; an update that changes others too keeps the change without them. The fields are left out of every change of the resource, so [events](events.md), [derived values](derived.md) and [live updates](live.md) do not see them either. The key, tenant and soft delete fields cannot be ignored, and an unknown field stops startup.
|
|
@@ -200,12 +200,20 @@ export const PushButton = () => {
|
|
|
200
200
|
const push = usePushNotifications()
|
|
201
201
|
if (push.state === 'loading' || push.state === 'unsupported') return null
|
|
202
202
|
if (push.state === 'blocked') return <p>Notifications are blocked in this browser's settings.</p>
|
|
203
|
-
|
|
204
|
-
return <Button onClick={() => void push.
|
|
203
|
+
const failed = push.failure && <p role="alert">Notifications could not be changed ({push.failure.kind}).</p>
|
|
204
|
+
if (push.state === 'on') return <Button loading={push.busy} onClick={() => void push.turnOff()}>Turn off notifications</Button>
|
|
205
|
+
return (
|
|
206
|
+
<>
|
|
207
|
+
{failed}
|
|
208
|
+
<Button loading={push.busy} onClick={() => void push.turnOn()}>Turn on notifications</Button>
|
|
209
|
+
</>
|
|
210
|
+
)
|
|
205
211
|
}
|
|
206
212
|
```
|
|
207
213
|
|
|
208
214
|
- Call `turnOn` straight from a click. The browser asks for permission then, and only then: without a click nothing happens, and push is never turned on when a page loads. Once the user said no, `turnOn` does not ask again and answers `blocked`. `state` is read again on a return to the page and when the browser says the permission changed, so it turns from `blocked` to `off` once the user allows notifications.
|
|
215
|
+
- `busy` is true while push is being turned on or off. When turning it on or off fails, `failure` says why until the next try, and the error goes to the console: the reason iOS or Android gave for not registering (`registration`), no push token from Apple's or Google's push service within 15 seconds (`no-token`), the server refusing the device (`refused`), a turn-off the device could not store, which may not outlast the app closing (`off-not-stored`), or anything else (`other`). The bell shows it, with a way to try again after a failed turn-on.
|
|
216
|
+
- In the iOS and Android app, a user who allowed notifications when the phone asked gets push on by itself when the app opens or they sign in. The app never asks on its own. Android before 13 grants the permission without asking, so there this happens only for a user who turned push on in the app on that phone before. Turning push off with `turnOff` keeps it off on that phone until they turn it on again; signing out does not. Releases from before the app turned push on by itself did not store a turn-off, so a user who turned push off in one of them, and allowed notifications when the phone asked, gets push on again once after the update; turning it off again keeps it off. `refresh` reads `state` again, as the bell does when it opens.
|
|
209
217
|
- Only someone signed in as themselves can turn push on: a visitor's click and staff signed in as the user do nothing.
|
|
210
218
|
- On iPhone and iPad, push works in the app added to the Home Screen; a browser tab answers `unsupported`.
|
|
211
219
|
- Signing out turns push off in this browser, and so does someone else signing in on it: what the browser showed is closed, the app's badge cleared, and the device removed. Signing in again as the same user keeps it on. Each push names the user its device is registered for, and the browser shows nothing of a push for another user than the one it holds push for.
|
|
@@ -231,7 +239,7 @@ Without them APNs is off and iOS devices are skipped. One or two of them set, a
|
|
|
231
239
|
|
|
232
240
|
The topic of every notification is the mobile app's `appId`. Each device goes to the environment it was registered with: development builds to the APNs sandbox, App Store and TestFlight builds to production. A device whose token is not lowercase hex, whose environment is neither `sandbox` nor `production`, or that was registered for another app id is `refused`.
|
|
233
241
|
|
|
234
|
-
When iOS refuses to register the app for push, such as for a build without the push entitlement, push stays off and the app's [error reporting](config/api.md#errorreporting) receives the reason iOS gave.
|
|
242
|
+
When iOS refuses to register the app for push, such as for a build without the push entitlement, push stays off and the app's [error reporting](config/api.md#errorreporting) receives the reason iOS gave. When the user pressed Turn on, the bell also shows the reason; registering by itself on launch or sign-in shows nothing in the bell. A push token that never arrives after Turn on also leaves push off, and the bell says so. <gap>That timeout is not sent to error reporting, because handling the token wait's timeout as a refusal is not implemented.</gap>
|
|
235
243
|
|
|
236
244
|
The notification's title and body are its alert, with its `badge` and `sound`; the JSON also holds `url`, `data` and `user`, the id of the user the device is registered for. `urgency` sets the priority (`very-low` and `low` wait until the device saves power less), `ttl` how long APNs keeps it for a device that is offline, 28 days without one, and `tag` the collapse id. A message's `platform.apns` is merged into the JSON, such as `{ aps: { 'thread-id': 'chat' } }`, never into the request's headers; a `url` in it is checked as the message's is, and the JSON holds at most 4096 bytes. APNs answering that the device is unregistered, or that its token is bad, removes the device; any other refusal, such as a wrong topic or key, is retried and then fails the send, so a mistake in the configuration removes no device.
|
|
237
245
|
|