summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Make the responses for various data creation requests more consistent.Owen Jacobson2024-10-19
| | | | | | | | | | | | | | | | | | | | In general: * If the client can only assume the response is immediately valid (mostly, login creation, where the client cannot monitor the event stream), then 200 Okay, with data describing the server's view of the request. * If the client can monitor for completion by watching the event stream, then 202 Accepted, with data describing the server's view of the request. This comes on the heels of a comment I made on Discord: > hrm > > creating a login: 204 No Content, no body > sending a message: 202 Accepted, no body > creating a channel: 200 Okay, has a body > > past me, what were you on There wasn't any principled reason for this inconsistency; it happened as the endpoints were written at different times and with different states of mind.
* Package upgrades (Node)Owen Jacobson2024-10-19
|
* Dependency upgrades (Rust)Owen Jacobson2024-10-18
|
* Cargo fmtOwen Jacobson2024-10-18
|
* BREAKING: Remove redundant error conversions now that 1.82 is stable.Owen Jacobson2024-10-18
| | | | MSRV is now 1.82.
* Merge branch 'wip/retain-deleted'Owen Jacobson2024-10-18
|\
| * Explain (some of) the rationale for returning "empty" values in tombstone ↵Owen Jacobson2024-10-18
| | | | | | | | events in the docs.
| * Switch to blanking tombstoned data with null, not empty string.Owen Jacobson2024-10-18
| | | | | | | | | | | | | | This accomplishes two things: * It removes the need for an additional `channel_name_reservation` table, since `channel.name` now only contains non-null values for active channels, and * It nicely dovetails with the idea that `null` means an unknown value in SQL-land.
| * Retain deleted messages and channels temporarily, to preserve events for replay.Owen Jacobson2024-10-17
| | | | | | | | | | | | | | | | | | | | | | | | Previously, when a channel (message) was deleted, `hi` would send events to all _connected_ clients to inform them of the deletion, then delete all memory of the channel (message). Any disconnected client, on reconnecting, would not receive the deletion event, and would de-synch with the service. The creation events were also immediately retconned out of the event stream, as well. With this change, `hi` keeps a record of deleted channels (messages). When replaying events, these records are used to replay the deletion event. After 7 days, the retained data is deleted, both to keep storage under control and to conform to users' expectations that deleted means gone. To match users' likely intuitions about what deletion does, deleting a channel (message) _does_ immediately delete some of its associated data. Channels' names are blanked, and messages' bodies are also blanked. When the event stream is replayed, the original channel.created (message.sent) event is "tombstoned", with an additional `deleted_at` field to inform clients. The included client does not use this field, at least yet. The migration is, once again, screamingingly complicated due to sqlite's limited ALTER TABLE … ALTER COLUMN support. This change also contains capabilities that would allow the API to return 410 Gone for deleted channels or messages, instead of 404. I did experiment with this, but it's tricky to do pervasively, especially since most app-level interfaces return an `Option<Channel>` or `Option<Message>`. Redesigning these to return either `Ok(Channel)` (`Ok(Message)`) or `Err(Error::NotFound)` or `Err(Error::Deleted)` is more work than I wanted to take on for this change, and the utility of 410 Gone responses is not obvious to me. We have other, more pressing API design warts to address.
* | Get loaded data using `export let data`, instead of fishing around in $page.Owen Jacobson2024-10-17
|/ | | | | | This is mostly a how-to-Svelte thing. I've also made the API responses for invites a bit more caller-friendly by flattening them and adding the ID field into them. The ID is redundant (the client knows it because the client has the invitation URL), but it makes presenting invitations and actioning them a bit easier.
* Organizational pass on endpoints and routes.Owen Jacobson2024-10-16
|
* API docs rewrite.Owen Jacobson2024-10-16
| | | | | | Having the whole API in a single file was starting to feel very cramped and constraining. This rewrite breaks it out into sections; as a side effect, the docs are now about 2.5x as long as they were, as the rewrite allows more space for each idea without crowding the page. The docs are best read by running `tools/docs-api`.
* Initial invite accept UIOwen Jacobson2024-10-12
|
* Return a distinct error when an invite username is in use.Owen Jacobson2024-10-11
| | | | I've also aligned channel creation with this (it's 409 Conflict). To make server setup more distinct, it now returns 503 Service Unavailable if setup has not been completed.
* Create APIs for inviting users.Owen Jacobson2024-10-11
|
* Split the login transaction, to reduce database contention during loginOwen Jacobson2024-10-11
|
* Stop creating accounts during login.Owen Jacobson2024-10-11
|
* Stray file, should never have been committedOwen Jacobson2024-10-11
|
* Provide a separate "initial setup" endpoint that creates a user.Owen Jacobson2024-10-11
|
* Merge branch 'wip/login-route'Owen Jacobson2024-10-11
|\
| * Move login to its own route.Owen Jacobson2024-10-11
| | | | | | | | This - in passing - fixes the problem where the client failed to subscribe after logging in, by causing the whole subscription process to be re-run when returning to the main interface.
| * Compute the active channel from the current routing state, not from a store.Owen Jacobson2024-10-10
| |
* | Add a `server` header to responses.Owen Jacobson2024-10-11
| |
* | Blind debug output for StoredHash.Owen Jacobson2024-10-11
|/ | | | This is a little excessive, as PasswordHash (which StoredHash converts to) _does_ derive Debug and exposes the hash, but I'll feel better if the hash never ends up in logs.
* Make the identity cookie available to routes outside of `/api/`.Owen Jacobson2024-10-10
| | | | We now (try to) use the identity cookie in `/ch/:channel`. This will not work, because the cookie's path doesn't include `/ch/`.
* Hoist the UI one step up furtherOwen Jacobson2024-10-10
|
* Remove redundancy in `hi-ui` directory name.Owen Jacobson2024-10-10
|
* Fix invalid migration.Owen Jacobson2024-10-10
| | | | | | The original version of this migration happened to work correctly, by accident, for databases with exactly one login. I missed this, and so did Kit, because both of our test databases _actually do_ contain exactly one login, and because I didn't run the tests before committing the migration. The fixed version works correctly for all scenarios I tested (zero, one, and two users, not super thorough). I've added code to patch out the original migration hash in databases that have it; no further corrective work is needed, as if the migration failed, then it got backed out anyways, and if it succeeded, you fell into the "one user" case.
* Oops. Fixes stray debug from 2f0b77e8.Owen Jacobson2024-10-10
|
* Return an instance of the client when opening a channel URL directly.Owen Jacobson2024-10-10
|
* Merge branch 'main' into wip/path-routing-for-channelsKit La Touche2024-10-10
|\
| * Automatically delete database backups if automatic restore is successful.Owen Jacobson2024-10-10
| | | | | | | | Operational experience with the server has shown that leaving the backup in place is not helpful. The near-automatic choice is to immediately delete it, and the server won't start until it has been deleted. If the backup restore succeeded, then we know the user has a copy of their database, since the sqlite3 online backups API promises to make the target database bitwise-identical to the source database, so there's little chance the user will need a duplicate.
| * Fix tests broken in f624a6a49c7a924cbaae41b3f73ee3fa655c459eOwen Jacobson2024-10-10
| |
| * Normalize `not found` errors a bit.Owen Jacobson2024-10-09
| |
| * Naming errorOwen Jacobson2024-10-09
| |
| * Disable server-side rendering for the root layout.Owen Jacobson2024-10-09
| |
| * Align send request fields with message fields by renaming `message` to `body`.Owen Jacobson2024-10-09
| |
| * Merge branch 'wip/event-vocabulary'Owen Jacobson2024-10-09
| |\
| | * Return a flat message list on boot, not nested lists by channel.Owen Jacobson2024-10-09
| | | | | | | | | | | | This is a bit easier to compute, and sets us up nicely for pulling message boot out of the `/api/boot` response entirely.
| | * Provide a view of logins to clients.Owen Jacobson2024-10-09
| | |
| | * Simplify channel IDs in events. Remove redundant ones.Owen Jacobson2024-10-09
| | |
| | * Use a two-tier hierarchy for events.Owen Jacobson2024-10-09
| | | | | | | | | | | | This will make it much easier to slot in new event types (login events!).
| | * Flatten nested `channel` and `message` structs in events and API responses.Owen Jacobson2024-10-09
| |/ | | | | | | This structure didn't accomplish anything and made certain refactorings harder.
* | Adjust app container height down a bit.Kit La Touche2024-10-10
| | | | | | | | | | I would love to make the whole-thing container 100vh, and let the row of the interface sort out its own height. I will, eventually, I guess.
* | Fix up on-navigation data loadingKit La Touche2024-10-09
| | | | | | | | Maybe this isn't ideal, but whatever.
* | Move a lot of things aroundKit La Touche2024-10-09
|/
* All kinds of stylingKit La Touche2024-10-08
|
* Style more thingsKit La Touche2024-10-08
|
* Rough in create forms at bottomKit La Touche2024-10-08
|
* Remove Flowbite, add Skeleton, add Markdown renderingKit La Touche2024-10-08
|