Changes in docs/shaer-c2s-api.md [f889429:30871c1] in Klonkt
- File:
-
- 1 edited
-
docs/shaer-c2s-api.md (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
docs/shaer-c2s-api.md
rf889429 r30871c1 80 80 | `GET /ap/users/:slug/outbox` | OrderedCollection of the account's own `Create(Note)` | 81 81 | `GET /ap/users/:slug/inbox` | OrderedCollection of recent inbound posts (accounts you follow) as `Create(Note)`. Owner only; `403` for anyone else. The unified home feed is outbox + inbox merged. | 82 83 ### Waiting for news on the inbox read84 85 The inbox read can hold the answer until there is something new, so a client does86 not have to poll. It is the **same call and the same response** — no separate87 endpoint and no separate "there is news" shape, because a second shape is a88 second description of a post that can drift from the first.89 90 ```91 GET /ap/users/:slug/inbox?since=<cursor>&wait=2592 ```93 94 - `since` is the `shaer:cursor` from your previous answer. Treat it as opaque.95 - `wait` is seconds, capped at 50 — well under what a proxy will hold.96 - Send neither and the route behaves exactly as it always did.97 98 Two possible answers:99 100 | | |101 |---|---|102 | **`200`** | something changed. The full, current collection with a fresh `shaer:cursor`. |103 | **`304`** | nothing changed within `wait`. **No body.** Keep the cursor you have and ask again. |104 105 `304` is not an error — it is the normal answer to a quiet minute, and it is why106 this costs nothing while nothing happens. Sending the whole timeline back every107 `wait` seconds just to say "still nothing" would be a poor trade for saving one108 round trip.109 110 A server that has not run the feed-state migration yet cannot tell change from111 stillness, and answers `200` with the collection every time rather than `304`112 forever. Slower, never wrong.113 114 The cursor moves for **all four** sources this read merges: the timeline,115 messages, replies on your own posts, and your own sent notes.116 117 Limits worth knowing as a client author:118 119 - four waiting connections per account. A fifth gets the current state120 immediately rather than an error, so a broken reconnect loop degrades to121 ordinary polling instead of locking the account out.122 - hanging up ends the wait; there is no cost to abandoning a request.123 - the bearer is checked *before* any waiting, so an unauthenticated caller can124 never hold a connection open.125 126 This works while your app is in the foreground, and only there. iOS freezes127 network activity the moment an app is backgrounded, and a held-open connection128 does not survive it.129 130 **There is no background channel to fall back on for a native app.** Klonkt's131 web push uses VAPID, which a self-hosted instance can generate and send entirely132 on its own — but only to a browser or an installed PWA. A native app receives133 push through APNs (or FCM), signed with the *application's* key, which a134 self-hosted Klonkt does not have and should not have: whoever holds it can push135 to every user of that app. Closing that gap needs a relay run by the app's136 publisher, and that is a decision about money and control, not a protocol137 detail.138 139 So for a self-hosted setup this is not a stopgap until push arrives. For now it140 is the freshness channel.141 82 | `GET /ap/users/:slug/followers` | see below | 142 83 | `GET /ap/users/:slug/following` | see below |
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)