Commit Graph

24 Commits

Author SHA1 Message Date
Karl Seguin
7819ee50fa Add and default to Blackhole storage
Tweak sqlite build to omit more features, hoping to shrink the size when sqlite
is used.
2026-04-26 09:04:33 +08:00
Karl Seguin
e7be3c8b14 still trying to get this test to pass 2026-04-20 18:57:45 +08:00
Karl Seguin
55d7bae943 more busy timeout tricks 2026-04-20 18:42:55 +08:00
Karl Seguin
fcd3d1cd14 Use unsafe journal_mode during Pool test
Can't use WAL, as it thread sanitizer reports false positives. The default,
delete, causes busy timeouts. Let's try the unsafe memory!
2026-04-20 18:14:29 +08:00
Karl Seguin
b226a9ed52 Disable WAL mode for Sqlite pool test
It seems like there are known false positives with thread sanitizer and sqlite.

(There are various references to this in sqlite's wal.c and also possibly
related https://bugzilla.mozilla.org/show_bug.cgi?id=1153409
2026-04-20 17:16:42 +08:00
Karl Seguin
6d0003ad2b Sqlite
This adds an app.storage which is a union around configurable storage engine
(currently, only sqlite).

It is _not_ being used anywhere right now. The goal is to get feedback on
the implementation and then move cache to it.

This doesn't expose a generic query API. The goal is that the storage will
expose high level methods, e.g. `cacheGet(req: CacheGetRequest)` and every
storage engine will translate the `storage.CacheGetRequest` as needed.

A thin wrapper around the Sqlite C api is included, e.g. exec(SQL, .{args}) a
`rows` and `row` fetcher. A connection pool is included. By default, an
in-memory DB is currently created. And a `migrations` table with an id of `1`
is created/inserted. I don't imagine needing fancy migratations.
2026-04-20 17:13:06 +08:00
Karl Seguin
b8d7744563 replace zig-js-runtime 2025-04-15 15:18:04 +08:00
Pierre Tachoire
c88bc65379 cookie: use a ; w/o space for cookie separator in requests 2025-04-11 12:40:16 +02:00
Karl Seguin
be75b5b237 Add URL struct
Combine uri + rawuri into single struct.

Try to improve ownership around URIs and URI-like things.
 - cookie & request can take *const std.Uri
   (TODO: make them aware of the new URL struct?)
 - Location (web api) should own its URL (web api URL)
 - Window should own its Location

Most of these changes result in (a) a cleaner Page and (b) not having to carry
around 2 nullable objects (URI and rawuri).
2025-04-09 18:19:07 +08:00
Karl Seguin
84dfde2e51 add cookies to XHR requests 2025-03-31 18:44:09 +08:00
Karl Seguin
22d33fa286 Add cookie support to browser (not XHR yet) requests 2025-03-31 18:44:09 +08:00
Karl Seguin
21c9dde858 Zig 0.14 compatibility 2025-03-19 16:28:15 +01:00
Karl Seguin
9fec6ebc66 fix typo, improve comment, add 1 test case 2025-03-04 19:46:36 +08:00
Karl Seguin
a00d1d068a Cookie with SameSite=None is only valid when Secure 2025-02-27 16:47:39 +08:00
Karl Seguin
6f5028612a add cookie jar 2025-02-27 16:09:10 +08:00
Karl Seguin
c31c12d31a add test for Storage shed, use map.getOrPut 2025-02-27 11:57:46 +08:00
Karl Seguin
68fc87bc01 Add Set-Cookie parsing 2025-02-26 21:00:43 +08:00
Karl Seguin
4229b1d2a4 Report memory leaks when using std.testing.allocator
Fix leaks in storage bottle
2025-02-09 11:04:21 +08:00
Karl Seguin
fc0ec860b0 Tweak generate.Tuple and generate.Union
Leverage comptime fields to give generated Tuple a default value, allowing
TupleT and Tuple to be merged.

Only call generate.Tuple on the final output. This eliminates redundant
deduplication, and results in a simpler API (nested types just need to expose
a natural Zig tuple).

generate.Union leverages the new Tuple and removes unused features.
2025-02-01 14:53:00 +08:00
Pierre Tachoire
8f1557254a typo fix 2025-01-15 11:45:30 +01:00
Pierre Tachoire
f2a406d224 move netsurf and mimalloc into modules 2024-06-18 16:13:27 +02:00
Pierre Tachoire
2a3a243d1c add AGPL license header in zig files 2024-05-13 20:51:36 +02:00
Pierre Tachoire
61357ee7e0 storage: update comment about dispatch event 2024-05-02 15:21:21 +02:00
Pierre Tachoire
3c5d601622 storage: first implementation of webstorage API 2024-04-24 11:54:41 +02:00