History, comments and live updates
- Record history: Every change to a record is kept with who made it and when, including changes made outside the API.
- Ignored fields: Fields the database keeps up to date itself, such as counts, can be left out of a record’s history, so their changes add no entries.
- Activity: Admins see all changes across resources in one list.
- History retention: Changes older than a set number of days are removed by a daily job.
- Comments: Anyone who can read a record can read and add comments on it.
- Comment formatting: Comments show bold, italic, strikethrough, code, code blocks, lists and quotes, and web addresses become links that open in a new tab.
- Mentions: Mentioning a colleague in a comment sends them an email with a link to the record.
- Comment moderation: Admins find and delete comments across the app.
- Live updates: Open lists and record pages refresh within seconds when a record changes, including changes made outside the API.
- Live tokens (in development): A list or record read asked for with
Prefer: livealso returns an encrypted token that holds what the reader read and may read, with the read’s snapshot, bound to their session; a sign-out or revoke of that session stops its changes. In an app with the relay, pages subscribe with it on the relay’s one socket and poll where the relay cannot keep a resource live. - Refreshing access (in development): An API function tells a person’s open pages to read again once their access changed, so they get new tokens.
- Live views (experimental): A resource backed by a view updates live when the tables it reads change.
- Change stream: Apps follow record changes over a stream that catches up after a reconnect.
- Changes in the write-ahead log (in development): A reader of the database’s write-ahead log learns who made each change and, when switched on, each schema change, from logical messages in the change’s own transaction, and maps each table to its resource from the change model
protobase buildwrites into the bundle’s manifest. - Polling, then a socket: Apps and Node scripts poll for changes first and switch to a WebSocket after 30 seconds, or at once, falling back to polling while the socket is down.
- Presence (beta): Apps see who else has a record open and what each of them tracks, such as online or away, for whoever may read the record.
- Realtime relay (in development): Apps hand their realtime connections to a relay, so they and their database can sleep while people stay connected.
protobase devruns the relay for the app, and on a platform that runs it the app moves to it when the platform says so, with its build’s manifest telling the platform what it needs. - Organization-wide relay channels (in development): One channel resource holds channels for the whole organization beside channels for the people they list, such as a chat’s public and private channels: a record whose members field is null reaches everyone in its organization, and people who join or leave the organization join or leave its channels on their open sockets.
- Relay presence (in development): The relay reports who comes online, goes away and goes offline; the app keeps it in a resource of its own, raises that resource’s events, so workflows can act when someone goes offline, and tells the people who share a conversation with them, whose sidebar and members page show them online, away or offline.
- Relay in pages (in development): Pages follow the relay on one socket: open views stay current from its notices and read again once after a reconnect, conversations show who types, sidebar groups say “typing…” and count unread messages without reading per message, also of a conversation the person was just added to, all by configuration;
client.relaygives the same from code. - Relay over server-sent events (in development): On a network that blocks WebSockets, pages connect to the relay over server-sent events by themselves and keep live updates, events and presence.
- Relay client events (in development): Each channel resource declares in the config the events its clients may send each other, such as typing, with a schema, a size and a rate.
- Broadcasts (beta): Apps on a record send each other short-lived events, such as typing, which are never stored, as JSON or as bytes, such as a chunk of audio or a drawing stroke; the app’s own code sends them too, from an API function, over HTTP or from SQL with
channels.send().