Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sqliteai/sqlite-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 74557b2
Choose a base ref
...
head repository: sqliteai/sqlite-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d7193fa
Choose a head ref
  • 10 commits
  • 9 files changed
  • 4 contributors

Commits on Nov 13, 2026

  1. fix: give the node and Flutter packages the version they are publishe…

    …d at
    
    Both carried a number from several releases back: packages/node/package.json
    said 1.1.14 and packages/flutter/pubspec.yaml 1.2.3, while the extension was
    at 1.4.1. The release job writes the real version into the working copy
    before publishing but never committed it, so the repository went on showing
    whatever was last committed.
    
    For the node package that was not only confusing. Its optionalDependencies
    pinned the seven platform packages to 1.1.14 as well, so an npm install in
    packages/node fetched binaries from long before the current source: no
    memory limit, no interrupt handler, none of the stack work. The published
    package was always right, since the release job rewrites all eight versions
    with jq before npm publish; only the repository was wrong.
    
    Both files now say 1.4.2, which is what is published, and the release job
    commits them from now on, in the same [auto-update] commit as the
    Package.swift checksum. The Flutter pubspec is rewritten there too, since
    flutter-package.yml only rewrites it after the tag; its sed stays as the
    safety net it is. The commit message keeps [auto-update], which is what
    keeps the build job from running again for it.
    
    Checked that all seven platform packages exist at 1.4.2 on the registry, so
    the pinned version resolves.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    marcobambini and claude committed Nov 13, 2026
    Configuration menu
    Copy the full SHA
    9fef917 View commit details
    Browse the repository at this point in the history
  2. merge pr-31

    Give the node and Flutter packages the version they are published at
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    marcobambini and claude authored Nov 13, 2026
    Configuration menu
    Copy the full SHA
    5f0b446 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2026

  1. Let the host cancel all running JavaScript

    sqlitejs_cancel_all() stops the JavaScript running in every connection:
    each call fails with an "interrupted" error, even code that catches
    every exception. JavaScript that begins afterwards runs normally.
    
    Android cannot otherwise stop a runaway function: it cancels a query
    with a progress handler, which SQLite never calls while a function runs,
    and Room 2.7 and later pass no cancellation signal at all. A global
    epoch, read when the outermost call into JavaScript begins and compared
    by the existing interrupt handler, makes the cancel reach every runtime
    without a list of connections. The interrupt handler is now installed
    even when sqlite3_is_interrupted() is unavailable (SQLite before 3.41),
    so cancelling still works there.
    
    When the cancel stops a call, the handler also interrupts that call's
    connection with sqlite3_interrupt(), so its statement stops too. A
    collation cannot report an error: without this, a sort went on calling
    it, each call beginning after the cancel, and never ended. Add to the
    Cancel all test a runaway collation that one cancel stops; it hung
    without this.
    
    The test's worker cancels only once the JavaScript under test has called
    started(), an SQL function, since a cancel that came first would leave
    the JavaScript running. If that has not happened within 10 seconds, the
    worker fails the test with a message instead of cancelling. Like the
    Interrupt test, a watchdog ends the program if the JavaScript cannot be
    stopped.
    
    Only a call into JavaScript is cancelled, not the JavaScript a connection
    runs while it is set up: a cancel then made the connection fail to load
    the extension (SQLITE_NOMEM), and an app's query on a new pool
    connection failed. The Cancel all test now opens 200 connections while
    another thread cancels without pause; without this, the first failed.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
    davidschachterADFA and claude committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    c52018c View commit details
    Browse the repository at this point in the history
  2. End a cancelled call's result sets as interrupted, and stop their finals

    Since 1.4.2 every result set still open when the outermost call into
    JavaScript returns is ended there, which runs the final of each window
    or aggregate function its statement was computing. Each final enters
    JavaScript as a new outermost call, so js_enter() took the cancel epoch
    of that moment and a cancel during the call no longer stopped it. On
    SQLite 3.41 and later the interrupt the cancel left on the connection
    does; before 3.41 nothing did, and a final that never ends hung the
    statement for good.
    
    The finals that ending a call's result sets runs now keep that call's
    epoch, so a cancel during the call, or during the ending, stops each of
    them at QuickJS's next interrupt check: one that never ends is stopped
    and the statement fails with an interrupt, though a short final can
    still run to its end. Reading on from those result sets throws
    "interrupted", as after sqlite3_interrupt() on 3.41 and later, rather
    than the message for a result set that outlived its call, whether the
    cancel came before the call returned or while its result sets were
    ended. js_end_rowsets() marks the latter after its loop, by the pass
    that ended them, since a final it runs can free result sets of the list.
    
    Before 3.41, an sqlite3_interrupt() that no cancel came with still reads
    as the result set outliving its call: nothing shows it.
    
    Test: Cancel all now covers both cases on any SQLite. A call that
    returns normally keeps two result sets of window functions whose finals
    never end, and the first final starts the cancel: both finals stop and
    both result sets read on as "interrupted". And a cancel that lands as a
    call returns, from SQL inside it, stops the long final that ending its
    result set runs, so the call fails and the final records nothing.
    Without this change the first fails with the "closed" message, and the
    second returns OK with the final run to its end. Upstream's suite
    passes 17 of 17, also under ASan, LeakSanitizer and UBSan.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
    davidschachterADFA and claude committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    a4feb7c View commit details
    Browse the repository at this point in the history
  3. Export sqlitejs_cancel_all from the Windows DLL

    The DLL exports only what the generated .def file lists, so the test
    program could not link sqlitejs_cancel_all() on Windows ("undefined
    reference" in the windows-x86_64 job). The .def file now lists it with
    the other public functions; it is the only export list in the project.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
    davidschachterADFA and claude committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    28ec1ad View commit details
    Browse the repository at this point in the history
  4. Address review: simplify js_leave, clarify the init exemption

    - js_leave no longer tests the cancel epoch: the block after the loop in
      js_end_rowsets already marks a cancelled call's result sets interrupted.
    - Say that only JavaScript the extension runs while it initialises a
      connection (globaljs_init, depth 0) is exempt from a cancel; stored
      functions loaded by js_init_table run as a call and can be cancelled.
    - Initialise rowset end_pass to 0 where a rowset is created.
    - Document sqlitejs_cancel_all in sqlitejs.h.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01Vh2DAXGyHbMzjSsi2zbrkw
    davidschachterADFA and claude committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    f0f6216 View commit details
    Browse the repository at this point in the history
  5. Never cancel the JavaScript that sets a connection up, and say so

    sqlitejs_cancel_all() exempted only the JavaScript run while the extension
    loads (globaljs_init, depth 0). The functions js_init_table(1) restores from
    the js_functions table ran as an ordinary call, so a cancel in flight stopped
    one: js_init_table(1) failed with "interrupted" and the connection came up
    without the function, reported only by a statement an app need not look at.
    With an init long enough to reach one of QuickJS's interrupt checks every
    load failed, which is exactly the Android pool this feature is for: a
    connection opened during a cancel could not run a query of its own.
    
    Loading a stored function is setting the connection up, as loading the
    extension is, so it is exempt too. js_create_common() records the depth of an
    is_load call in setup_depth and the interrupt handler leaves that depth alone.
    Only that call is exempt: JavaScript the loading code reaches through SQL is a
    call of its own, at a greater depth, and is still cancelled, so a runaway init
    can be stopped. On SQLite 3.41 and later sqlite3_interrupt() still stops setup
    JavaScript that never ends, as it always has.
    
    sqlitejs.h now also states what a cancel does besides stopping JavaScript: the
    connection is interrupted as sqlite3_interrupt() does it, which a collation
    makes necessary, so any other statement that connection has in progress fails
    with SQLITE_INTERRUPT and sqlite3_is_interrupted() stays true for it until the
    connection next prepares or steps a statement with none of its own running.
    
    Test: Cancel all now restores a stored aggregate, whose init code is long
    enough to reach an interrupt check, on ten connections while another thread
    cancels without pause, and checks the function it loads computes what it
    should once the cancels stop. Without the exemption the first connection
    fails. The suite passes 17 of 17, also under ASan, LeakSanitizer and UBSan,
    and ThreadSanitizer reports only the test watchdog's own pre-existing race.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    marcobambini and claude committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    b8898db View commit details
    Browse the repository at this point in the history
  6. release: 1.4.3

    SQLITE_JS_VERSION 1.4.2 -> 1.4.3, which is what the release is tagged with and
    what sqlitejs_version() reports: the release job reads make version, finds it
    differs from the latest release, and tags, publishes and releases under it. The
    node package.json and the Flutter pubspec.yaml are left alone, since that job
    writes them in its own [auto-update] commit.
    
    The changelog gains a 1.4.3 section for sqlitejs_cancel_all(): the function
    itself and what it does to the connection it stops, the result sets a cancelled
    call leaves open, and the setup JavaScript a cancel never stops.
    
    A patch release by the only measure that matters to existing code: nothing an
    application already does behaves differently, since all of this starts at a
    call to a function that did not exist before. It does add a C entry point,
    which Keep a Changelog would put in a 1.5.0.
    
    The built library reports 1.4.3 and the suite passes 17 of 17 on macOS arm64.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    marcobambini and claude committed Nov 16, 2026
    Configuration menu
    Copy the full SHA
    aa88a9e View commit details
    Browse the repository at this point in the history
  7. merge pr-34

    Let a host cancel all running JavaScript (pr-33), never cancel the JavaScript that sets a connection up, and release 1.4.3.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    marcobambini and claude authored Nov 16, 2026
    Configuration menu
    Copy the full SHA
    f18185b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d7193fa View commit details
    Browse the repository at this point in the history
Loading