Commit Graph

8321 Commits

Author SHA1 Message Date
Muki Kiboigo
25f4905487 add content_type column in Cache 2026-07-24 06:59:05 -07:00
Muki Kiboigo
b1e1a2a070 use real seconds value for migrations applied_at 2026-07-24 06:59:05 -07:00
Muki Kiboigo
a4e4e58892 add format for SqliteCachePath 2026-07-24 06:59:05 -07:00
Muki Kiboigo
c63d90b9d7 use CachePutRequest for puts instead of CacheMetadata 2026-07-24 06:59:05 -07:00
Muki Kiboigo
e00f903a7d clear old non-Vary headers on renew 2026-07-24 06:59:05 -07:00
Muki Kiboigo
7eae9814ef rework get to be strictly deferred 2026-07-24 06:59:05 -07:00
Muki Kiboigo
a38ca108bd add transaction begin types 2026-07-24 06:59:04 -07:00
Muki Kiboigo
70749a8077 remove cache eviction path from HttpClient 2026-07-24 06:59:04 -07:00
Muki Kiboigo
9aac078806 add test for no validators behavior 2026-07-24 06:59:04 -07:00
Muki Kiboigo
326d589acf always defer conn.rollback after tx begin 2026-07-24 06:59:04 -07:00
Muki Kiboigo
37ac81e995 early exit on SqliteCache.get on expired without validators 2026-07-24 06:59:04 -07:00
Muki Kiboigo
0901412de9 skip body dupe on expired without validators on Cache.get 2026-07-24 06:59:04 -07:00
Muki Kiboigo
3ae8dd847f check vary before we dupe in SqliteCache.get 2026-07-24 06:59:04 -07:00
Muki Kiboigo
d6890b7398 get rid of file variant in CachedData 2026-07-24 06:59:03 -07:00
Muki Kiboigo
6da1b6b919 manually delete and reinsert 2026-07-24 06:59:03 -07:00
Muki Kiboigo
e54e1aa9b9 loadBody can return null 2026-07-24 06:59:03 -07:00
Muki Kiboigo
4690ffe789 remove Storage and FsCache 2026-07-24 06:59:03 -07:00
Muki Kiboigo
998f42abe5 remove primary key on url name 2026-07-24 06:59:03 -07:00
Muki Kiboigo
51c43e3ba9 use strict tables 2026-07-24 06:59:03 -07:00
Pierre Tachoire
482795f0f4 cap delta-seconds values per RFC 9111
Huge max-age/Age header values previously either panicked in the
i64 casts when storing metadata, or were silently truncated to their
first 8 digits by the fixed-size lowercase buffer in
CacheControl.parse. Cap them at 2^31 as RFC 9111 §1.2.2 prescribes
and compare directives case-insensitively without truncation.
2026-07-24 06:59:03 -07:00
Muki Kiboigo
b8f8bc3ee0 add SqliteCache as default local impl 2026-07-24 06:59:00 -07:00
Karl Seguin
044d5c9186 Merge pull request #3047 from lightpanda-io/parse-terminate-guard
stability: Poll terminate state during large HTML parsing
2026-07-24 21:36:40 +08:00
Karl Seguin
3364de74af Merge pull request #3045 from lightpanda-io/notificaiton-reregister-safe
cdp: ignore duplicate enable calls
2026-07-24 19:24:32 +08:00
Karl Seguin
0066cad4d9 Merge pull request #3041 from lightpanda-io/runner-tick-preload
perf, fix: Avoid tight tick loop before page loads
2026-07-24 17:28:16 +08:00
Karl Seguin
553a3bad08 Merge pull request #3046 from lightpanda-io/resize-observer-perf
perf: improve ResizeObserver performance
2026-07-24 17:28:00 +08:00
Karl Seguin
5a59743f13 stability: Poll terminate state during large HTML parsing
V8's terminate isn't pre-emptive. We can arm it, but it still hast to cross
a boundary to fire. JavaScript that triggers a near endless Zig loop won't be
able to interrupt the Zig code:

```
while (true) {
  el.innerHTML += el.innerHTML;
}
```

Can generate a huge HTML input that the Parser will work on for ages. I don't
have a general solution to this. I've made the Parser (and DOMParser) check the
terminate state every 1024 appends. This only covers one specific case, but it's
possibly common enough to guard again, specifically because we don't have
rendering/dimensions, and many websites will append text until certain
dimensions are reached.

But it wouldn't for example, catch a similar:

while (true) {
  el.appendChild(el.firstChild.cloneNode(true));
}
2026-07-24 17:17:33 +08:00
Karl Seguin
4565501aa8 Merge pull request #3034 from mh0pe/codex/svg-02-values
webapi: add live SVG scalar values
2026-07-24 14:13:41 +08:00
Karl Seguin
d75747fd20 Merge pull request #3035 from lightpanda-io/Float16Array
v8: Expose Float16Array
2026-07-24 11:54:38 +08:00
Karl Seguin
e2f80ace33 update v8 dep 2026-07-24 11:34:45 +08:00
Karl Seguin
122a4f1001 perf: improve ResizeObserver performance
https://github.com/lightpanda-io/browser/pull/3000 improved the correctness of
ResizeObserver. The main changes were (a) making sure an observe results in
an initial callback and (b) invoking the callback for cases that we can
identity (e.g. visibility change).

Like the other observers, we triggered a check on domChanged. But, unlike the
other observers, the check is relatively expensive, namely because it involves
style lookups.

This commit introduces a number of performance improvements to reduce the check
and dispatch frequency.

1 - Only trigger on an allow list of attribute changed (id, class, hidden, width
 ...)
2 - Pre-filter only on observed elements
3 - Leverage the visibility cache for more efficient delivery
2026-07-24 11:23:00 +08:00
Karl Seguin
ed9a25f470 fix test 2026-07-24 10:18:59 +08:00
Karl Seguin
a6af331ab2 zig fmt 2026-07-24 08:25:21 +08:00
Karl Seguin
2b945aa1f9 cdp: ignore duplicate enable calls
CDP driver can send multiple Network.enable which would register the same
listener multiple times. This commit makes it so that only one (the first)
callback registered for a listener+eventtype is used. Subsequent registration
for the same listener+eventtype are ignored. This is safe because all callbacks
are currently static. It's a mistake (enforced by a debug-only assertion) for
code to try to register a different callback for an already registered listener+
eventtype.

This generalizes https://github.com/lightpanda-io/browser/pull/3038
2026-07-24 08:20:32 +08:00
Karl Seguin
de85a51dda Merge pull request #3039 from lightpanda-io/fix-help-pager
cli: fix help pager broken by lp.io's failing allocator
2026-07-24 08:10:45 +08:00
Karl Seguin
8fbcc7e5c1 Merge pull request #3015 from lightpanda-io/cdp-utf8-sanitization
cdp: Sanitize non-UTF 8 values
2026-07-24 08:03:38 +08:00
Karl Seguin
76e2e7e619 Merge pull request #2983 from lightpanda-io/layer-ordering
css: Respect @layer priority
2026-07-24 08:03:03 +08:00
Karl Seguin
05957a2eb9 Merge pull request #3044 from lightpanda-io/fix-report-error-crash
Fix Seg Fault on `window.reportError`
2026-07-24 08:01:53 +08:00
Muki Kiboigo
fccd6bf90b acquire ref on event before dispatchDirect on reportError 2026-07-23 12:57:59 -07:00
Madison Steiner
c40a2ccac6 webapi: add live SVG scalar values 2026-07-23 08:18:43 -07:00
Karl Seguin
40894a6bfd Merge pull request #3008 from lightpanda-io/zig-0.16-flake
Update Nix flake for Zig 0.16
2026-07-23 21:35:41 +08:00
Muki Kiboigo
791af8fded update Nix flake for Zig 0.16 2026-07-23 05:54:13 -07:00
Karl Seguin
542d9a333b perf, fix: Avoid tight tick loop before page loads
https://github.com/lightpanda-io/browser/pull/2999 fixed a spin loop when the
page had no i/o but had tasks, something we'd expect to see at page-load end.
But it introduced a similar spin loop as what it fixed on page-start, before the
page has anything to do.

Specifically, 2999 preventing i/o pollings when tasks were waiting. But, the
code doesn't run tasks until there's a "runnable" task. On Frame start, we
register a background task. Net result is that, for the first 200ms, everything
is fine, but then the task is due, so we don't poll, but we also don't run the
tasks, repeating a tick(0) loop.

The solution is simply to disable the 2999 optimization when there's no
runnable page.
2026-07-23 20:10:40 +08:00
Pierre Tachoire
3c925f740c Merge pull request #3040 from lightpanda-io/fix/lightpanda-request-blocking
Fix/lightpanda request blocking
2026-07-23 12:39:17 +02:00
Adrià Arrufat
4840a96645 cli: fix help pager broken by lp.io's failing allocator
std.Io.Threaded.init_single_threaded sets .allocator = .failing, which
spawnPosix uses to build the child's argv/env, so
std.process.spawn(lp.io, ...) always returns OutOfMemory and printPaged
silently fell back to plain output. Spawn the pager through a local
Threaded instance with a real allocator and the real environ (the
single-threaded one is empty, breaking PATH lookup of the less
fallback).
2026-07-23 12:16:19 +02:00
Pierre Tachoire
303a3666b6 don't count blocked redirects as followed
Move the http_redirects metric increment after the URL block check so a
redirect that gets blocked is recorded as an error, not a redirect.
2026-07-23 12:15:50 +02:00
Pierre Tachoire
43d17a78f2 skip empty URL block patterns consistently
Centralize empty-pattern filtering in UrlBlocklist.init/initPatterns so
the CDP setBlockedURLs path matches the CLI --block-urls behavior. Keep
blocks aligned with the filtered patterns.
2026-07-23 12:15:49 +02:00
Matt Van Horn
dee40075a0 feat(cdp): implement Network.setBlockedURLs via urlPatterns
Reimplement request blocking on the non-deprecated urlPatterns shape:
each pattern carries an explicit block/allow flag (first match wins),
UrlBlocklist owns the compiled patterns plus their block flags, and the
legacy setBlockedUrls path stays for back-compat. Tests updated.
2026-07-23 12:15:49 +02:00
Matt Van Horn
311ab3aaae feat(cdp): add Network.setBlockedURLs and --block-urls request blocking 2026-07-23 12:15:47 +02:00
Pierre Tachoire
1d3e9617c4 Merge pull request #2891 from lightpanda-io/nikneym/custom-cert-load
Support loading custom CAs (`--ca-cert`, `--ca-path`)
2026-07-23 11:33:30 +02:00
Pierre Tachoire
b90d9def84 remove dead condition 2026-07-23 11:12:50 +02:00