Commit graph

444 commits

Author SHA1 Message Date
Sebastian Jeltsch
3e5a030be2 Update Rust dependencies. 2026-04-17 17:00:17 +02:00
Sebastian Jeltsch
919dad9634 Remove more immediate uses of rusqlite::Connection. 2026-04-17 13:40:43 +02:00
Sebastian Jeltsch
fd7e34a8c3 Make server limits configurable. 2026-04-17 12:34:24 +02:00
Sebastian Jeltsch
e08e648a0f Model DB transactions from WASM as a WASI resource and use a watchdog task to force unlock the DB after 60s.
This is implemented as a minor WASI world update, i.e. it's backward compatible. WASM guests build against future runtime releases (JS & Rust) will transparently use the new APIs w/o anychanges to user code.
2026-04-17 11:13:21 +02:00
Sebastian Jeltsch
a692d8857a Have DB transcation WASM host implementations await a DB lock asynchronously. Add more tests. 2026-04-16 17:35:58 +02:00
Sebastian Jeltsch
b95fd271b5 Explicitly mark read-only sqlite connections using the query_only pragma. 2026-04-15 16:30:39 +02:00
Sebastian Jeltsch
c09821de0b Add updated/created timestamps to accounts page in the admin dashboard. 2026-04-15 16:16:25 +02:00
Sebastian Jeltsch
81b4853aed Cleanup trailbase-sqlite error handling. 2026-04-15 15:56:53 +02:00
Sebastian Jeltsch
eac139dcfe Use index-0 SQLite thread both for reading and writing. Additionally, some more API consistency/cleanups. 2026-04-15 15:06:52 +02:00
Sebastian Jeltsch
a58af3e612 Audit remaining uses of "leaky" trailbase_sqlite APIs and remove some unecessary uses. 2026-04-15 13:06:58 +02:00
Sebastian Jeltsch
6e9f0bb1e3 Move trailbase-sqlite APIs around and further untangle rusqlite from Row[s]. 2026-04-15 10:23:31 +02:00
Sebastian Jeltsch
fdec5d359f Prepare new client releases. 2026-04-14 16:51:40 +02:00
Sebastian Jeltsch
68221d0545 Update Rust dependencies. 2026-04-14 16:17:28 +02:00
Sebastian Jeltsch
fefe1c73eb Rust client: log out on 401 token refresh. 2026-04-14 16:17:27 +02:00
Sebastian Jeltsch
f4c4d540c7 Improve error message from unexpected WASM component failures, e.g. a component panics. 2026-04-14 16:17:27 +02:00
Sebastian Jeltsch
5e907590f4 Stricter WASM SQLite query filter to avoid specific sqlean SELECT queries to run on read-only connections. 2026-04-14 16:17:27 +02:00
Sebastian Jeltsch
62cd6f4ce5 TS client: 401s during token refresh now unset the user. There's no means to recover. 2026-04-14 16:17:17 +02:00
Sebastian Jeltsch
d4cd85dd73 Make auth-ui's profile login more resilient to invalid cookies. 2026-04-14 16:17:17 +02:00
Sebastian Jeltsch
4dc6ce0b90 Load *.wasm components via symlinks. Fixes blog example's auth UI.
Minor: also fix avatar fallback in blog example.
2026-04-14 16:17:17 +02:00
Sebastian Jeltsch
4f6b305497 Clean-up trailbase_sqlite::Connection options and fix benchmark builds. 2026-04-14 16:16:55 +02:00
Sebastian Jeltsch
3e0ae46971 Absorb rusqlite's FromSql trait and start experimenting with a polymorphic connection type. 2026-04-14 12:19:30 +02:00
Sebastian Jeltsch
01f0edb5ef PoC: split sqlite connection into a public API and an internal minimal rusqlite executor. 2026-04-14 12:17:26 +02:00
Sebastian Jeltsch
5defef582f Fix invalid use of sqlean's SELECT define() in test setup. 2026-04-14 12:17:25 +02:00
Sebastian Jeltsch
59ec41a260 Further reduce leaky trailbase_sqlite::Connection API surface. 2026-04-12 13:31:03 +02:00
Sebastian Jeltsch
23b659b8c6 Introduce our own Value/ValueRef types to trailbase_sqlite. This is generally good practice but also a pre-requisite if we ever wanted to support other DBs.
Also stop leaking `rusqlite::Error`. Note that we're still leaking `rusqlite::Connection` itself in `Connection::call.*` and locking APIs.
2026-04-11 13:06:16 +02:00
Sebastian Jeltsch
4e9ea268ff Remove unsafe query construction from WASM guest examples and add a safe string-literal construction utility to guest runtimes. 2026-04-09 11:11:45 +02:00
Sebastian Jeltsch
083a2880b2 Reduce locking during config access in reactivity library - use ArcSwap instead - and use it downstream.
Previously accessing the config would require claiming an exclusive lock, sometimes warranting an expensive clone.
2026-04-09 11:10:52 +02:00
Sebastian Jeltsch
57375d29e8 Fork and streamline reactivate. 2026-04-08 17:43:59 +02:00
Sebastian Jeltsch
3ab6f288c0 Update Rust and JS dependencies. 2026-04-08 14:05:45 +02:00
Sebastian Jeltsch
eeb52692a8 Fix migration filename and named placeholder construction to work for any unicode character.
Our migration library doesn't seem to work with whitespaces.
2026-04-08 13:54:03 +02:00
Sebastian Jeltsch
dcb5a7636d Add an allowlist for custom auth redirects. 2026-04-07 20:11:04 +02:00
Sebastian Jeltsch
9c07c1693f Prepare client releases. 2026-04-07 19:48:36 +02:00
Sebastian Jeltsch
b4250f517e Prepare new release v0.26.0. 2026-04-07 14:09:34 +02:00
Sebastian Jeltsch
30d1920ce5 TS client: add an onLoss callback option to trigger some response to event loss. 2026-04-07 14:09:34 +02:00
Sebastian Jeltsch
d77df8e18b Rust client: support programmatic change event error statuses. 2026-04-07 14:09:34 +02:00
Sebastian Jeltsch
1e5aa4a296 TS Client: support new error ChangeEvent encoding with programmatic status. 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
7ca34c310c Switch ErrorEvent statuses to an integer representation and update Dart client to support it as well as sequence numbers. 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
e8eaacfc7c Massively overhaul change event execution model.
* minimize work in SQLite's preupdate hook
* push brokering onto a separate thread
* kick filter and acl checking further downstream into the SSE handlers.
* add layered sequence numbers to detect server-side event losses and allow clients to detect client-side event losses.
2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
175800287f Update Rust dependencies. 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
847697c069 Fix WASM "ATTACH DATABASE" and sqlite error unpacking. #221 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
d65979766e Simplify the brokering logic and locking.
We should think about further ways to make message delivery async. There
may be implications with respect to event ordering :/.
2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
1f918d9022 Break up record api subscriptions into multiple files. 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
299ab0f3d6 Add a stress test for subscriptions. 2026-04-07 14:09:26 +02:00
Sebastian Jeltsch
be097c00c3 Add a sequence number to SSE change events. This is important to discover transparent re-connects and discover missed events on the client-side.
This change took a while, since I first switched to internally tagged unions, which would be easier to handle by most client.
However, after thinking carefully given the cost of wire-format changes, I concluded that externally tagged is the way to go.
It's needed to support different value schemas for insert/update/delete, which would be required for Avro.

In the future we should also add facilities to the client to discover such losses, e.g. using a callback API.
2026-04-07 14:09:22 +02:00
Sebastian Jeltsch
8cf7c09eb2 Fix builds for Rust client's ws feature. 2026-04-06 18:36:28 +02:00
Sebastian Jeltsch
c26ac29df1 Add debug-build JSON schema validation to records create/update/list. 2026-03-31 20:52:24 +02:00
Sebastian Jeltsch
e658a84451 Fix JSON schemas for foreign keys and nullable JSON objects. 2026-03-31 20:52:24 +02:00
Sebastian Jeltsch
b33400a415 Stricter request Content-Type handling. Some preparations for multiple response content-types. 2026-03-31 20:52:22 +02:00
Sebastian Jeltsch
9ecd7c11b7 Allow concurrent SELECTs from WASM guests, while still allowing the use of ATTACH/DETACH DATABASE. #221 2026-03-31 11:01:40 +02:00
Sebastian Jeltsch
1e8cd99fb4 TS client: rename s/Event/ChangeEvent + re-export as Event to stop confusing rollup. 2026-03-27 17:10:50 +01:00