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-sync
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.2.0
Choose a base ref
...
head repository: sqliteai/sqlite-sync
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.2.1
Choose a head ref
  • 16 commits
  • 64 files changed
  • 5 contributors

Commits on Oct 1, 2026

  1. fix(deploy): default the Fly Supabase db image to the :17 tag (#85)

    The :17-alpine tag was retired when :17 moved to the Alpine base, so the
    default no longer tracked releases. Deployments without CLOUDSYNC_IMAGE now
    pull the current released image.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
    andinux and claude authored Oct 1, 2026
    Configuration menu
    Copy the full SHA
    53843ed View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2026

  1. Create LICENSE

    marcobambini authored Oct 19, 2026
    Configuration menu
    Copy the full SHA
    0fcc3dd View commit details
    Browse the repository at this point in the history
  2. Update README.md

    marcobambini authored Oct 19, 2026
    Configuration menu
    Copy the full SHA
    fb8ffa5 View commit details
    Browse the repository at this point in the history
  3. Delete LICENSE.md

    marcobambini authored Oct 19, 2026
    Configuration menu
    Copy the full SHA
    3bb9474 View commit details
    Browse the repository at this point in the history
  4. ci: skip the build workflow for docs, markdown and license changes

    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    andinux and claude committed Oct 19, 2026
    Configuration menu
    Copy the full SHA
    9696115 View commit details
    Browse the repository at this point in the history
  5. ci: fail the Windows dependency step when sqlite3 is not installed

    choco exits 0 when the community feed is unreachable, so the missing
    sqlite3 only surfaced at the end of make test.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    andinux and claude committed Oct 19, 2026
    Configuration menu
    Copy the full SHA
    3ef68f8 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2026

  1. feat(network): advertise apply-defer on /apply and confirm before rep…

    …orting nothing unsent (#88)
    
    Send X-CloudSync-Capabilities: apply-defer on every /apply chunk, inline and
    S3 form, so a CloudSync server whose tenant is saturated may accept a chunk
    durably and answer 202. The existing send path already handles that answer.
    
    cloudsync_network_has_unsent_changes() now compares against
    lastConfirmedVersion, so accepted-but-unapplied work is not reported as safe
    to discard before logout. API.md documents send.serverVersion as the accepted
    version; docs/internal/network.md lists the custom-transport requirements.
    
    A loopback HTTP server test drives the real libcurl transport: header on every
    /apply only, the 202 -> syncing -> /status -> synced lifecycle, rollback with
    and without failures.apply, 503/409 keeping the checkpoint, and a multi-chunk
    batch mixing inline and S3 chunks.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    andinux and claude authored Oct 20, 2026
    Configuration menu
    Copy the full SHA
    64cca81 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2026

  1. feat(network): handle a busy server with Retry-After (retryAfter/retr…

    …yCode, gate, reset_retry_after) (#89)
    
    * feat(network): report a busy server as retryAfter/retryCode and honor Retry-After in sync
    
    A CloudSync answer of 429, or 503 with Retry-After, is now a result instead of
    an SQL error. send_changes, receive_changes and sync return their normal JSON
    with retryAfter (seconds, 0 without a hint) and retryCode (errors[0].code, or
    http_<status>) in the refused block. A refused send keeps its checkpoint and is
    re-sent as a new batch; sync still runs its receive phase after one.
    
    The sync receive loop waits a Retry-After instead of wait_ms when it fits the
    remaining wait_ms * (max_retries - 1) budget, and returns reporting it
    otherwise, so a call never waits longer than before. A 503 without Retry-After
    and an HTTP-date Retry-After keep today's behaviour, as does every reply from
    current servers, which send neither.
    
    NETWORK_RESULT gains trailing http_status/has_retry_after/retry_after fields,
    filled by the libcurl and Apple transports; custom transports that leave them
    zero keep the previous behaviour.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * feat(network): hold send and receive until Retry-After expires, add cloudsync_network_reset_retry_after()
    
    After a busy refusal, or a /check answered with a delay, send and receive now
    return the same result with a countdown retryAfter, without contacting the
    server, until the deadline passes. Send and receive keep separate deadlines, in
    memory per connection, on the monotonic clock. sync(wait_ms, max_retries)
    waits out a pending deadline that fits its budget before the first /check.
    
    cloudsync_network_reset_retry_after() clears both deadlines, for refreshes the
    user asked for explicitly.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * fix(network): a busy or held result never asks to be called again at once
    
    Loops written against the previous API.md guidance (send until status leaves
    out-of-sync, receive while complete is false) would spin at full CPU during a
    Retry-After wait, and a 429 without Retry-After would resend with no pause.
    
    - A busy or held send reports status "syncing" (also covers a busy /status
      with nothing pending), a busy or held receive reports complete:true.
    - A 429 without a usable Retry-After waits a default of 5 seconds.
    - A new cloudsync_network_init() clears the wait; a token refresh keeps it.
    - A busy refusal whose code cannot be copied sets no wait.
    - One helper takes the busy fields at the three call sites.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * docs(api): receive.complete true means nothing more ready now, not fully synced
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * docs(api): add a single-statement SQL loop for bounded sends
    
    Covered by network_unit: the loop drains a backlog in bounded sends and stops
    after one call against a busy server.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * docs(api): stop the SQL send loop when a send makes no progress
    
    Tested: the loop stops after two calls when the server keeps failing a send,
    and on a WAL database another connection sees each checkpoint commit and can
    write during the loop.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * docs(api): recommend WAL mode when other connections write while syncing
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * test(network): create the SQL loop test database in the working directory (Android has no /tmp)
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * fix(network): report a refused send as status busy instead of syncing
    
    syncing keeps one meaning (the server holds the changes); busy means the
    server refused the send and asked to wait retryAfter seconds. Loops that
    continue only on out-of-sync still stop after one call.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
    andinux and claude authored Oct 21, 2026
    Configuration menu
    Copy the full SHA
    20a1eaa View commit details
    Browse the repository at this point in the history
  2. feat(payload): end a receive window with nothing visible in an empty …

    …final chunk (#90)
    
    * feat(payload): end a receive window with nothing visible in an empty final chunk
    
    On the receive side (exclude_filter_site_id), cloudsync_payload_chunks()
    returned no chunk when every change in the window was hidden from the caller
    by row-level security, or was the caller's own. The caller then had no
    watermark to checkpoint at and scanned the same window again on every
    request, at the same cost, until a change it could read arrived.
    
    Such a window now ends with one final chunk carrying no rows and the
    watermark. Applying it moves the receive checkpoint past the window; clients
    from 1.1.0 on already do this. A window with nothing new still returns no
    chunk, and the send path never produces an empty one.
    
    The watermark of a receive window is now read from the metadata tables
    instead of through cloudsync_changes, which drops the rows the caller cannot
    read: a caller that could read nothing got a watermark of 0.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * docs: describe the empty final chunk of a receive window
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * fix(payload): bound the receive watermark probe and fix its error paths
    
    - The probe for the newest change from another site now stops at the
      window's lower bound (since, or resume_db_version on a positional call).
      It no longer walks back through the caller's own recent changes below it.
      A window with nothing new still returns no chunk.
    - Building the probe SQL no longer frees the statement text twice when
      sqlite3_mprintf runs out of memory, and the error reported for that case
      is the out-of-memory message instead of an unrelated earlier one.
    - Drop the emitted flag: chunk_index == 0 already says whether the scan
      produced a chunk.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
    andinux and claude authored Oct 21, 2026
    Configuration menu
    Copy the full SHA
    e9f363e View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2026

  1. docs(changelog): shorten the unreleased entries (#95)

    Co-authored-by: Claude Opus 5.5 <[email protected]>
    andinux and claude authored Oct 22, 2026
    Configuration menu
    Copy the full SHA
    7b912ca View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2026

  1. perf(changes): skip lookups of rows hidden by RLS and look up visible…

    … rows once (#94)
    
    * perf(changes): skip lookups of rows hidden by RLS and look up visible rows once
    
    cloudsync_col_value decided visibility with one pk lookup per change row,
    so a first sync under row-level security paid a lookup and a rule
    evaluation for every change row in the history, almost all hidden.
    
    Each cloudsync_changes cursor now owns per-scan state, passed to
    cloudsync_col_value as a bound pointer (internal 4th argument). Once a
    table's lookups in the scan have returned 1000 hidden rows, one SELECT
    of its pks (under the same RLS rule and snapshot) builds a hash set, and
    pks not in it are answered as hidden without a lookup. Pks whose stored
    form could differ from their encoding (affinity conversion, non-binary
    collation, non-minimal encoding) keep the lookup, and a write on the
    connection mid-scan drops the set.
    
    The scan's WHERE re-evaluated cloudsync_col_value for the result column,
    so every visible row was looked up twice; the second call now reuses the
    value read by the first.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * fix(changes): look up pks whose bytes differ from the encoder's form
    
    The visible-pk set holds the hashes of pks encoded from the base rows, so a
    change row's pk can be answered from it only when its bytes are exactly what
    the encoder produces for the values it decodes to. The check compared only
    the encoded size and the column types, but the decoder also accepts other
    byte forms of an integer of the same size (0 tagged as a negative integer,
    a magnitude above INT64_MAX). Such a pk can arrive in a peer's payload and
    is stored as received; its row was found by the lookup but missed by the
    set, so the change was left out as hidden.
    
    The check now re-encodes each decoded integer and compares the bytes, and
    requires the minimal length header for text and blob values. Any other pk
    keeps the lookup.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * perf(changes): check the visible-pk set's column order and keep an oversized set off
    
    The set query read the pk columns from pragma_table_info at scan time, while
    the lookup binds the metadata pk values in the order its WHERE was generated
    in when the table was initialized. The build now requires the current pk
    count to match the table's and the lookup's WHERE to list the pk columns in
    the same order; otherwise the scan keeps the lookups.
    
    A set that exceeds the row cap was discarded after a full scan of the table,
    and every later scan, including each chunk of the same download, scanned it
    again. A table whose set exceeded the cap now keeps the per-row lookups for
    the rest of the connection.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
    andinux and claude authored Nov 2, 2026
    Configuration menu
    Copy the full SHA
    1754eab View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2026

  1. fix: harden payload validation, PostgreSQL entry points and network h…

    …andling (#96)
    
    Co-Authored-By: Marco Bambini <[email protected]>
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    3 people authored Nov 5, 2026
    Configuration menu
    Copy the full SHA
    11aa77f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4beeade View commit details
    Browse the repository at this point in the history
  3. chore(release): 1.2.1

    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    andinux and claude committed Nov 5, 2026
    Configuration menu
    Copy the full SHA
    294da6b View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2026

  1. fix(release): ship the Apache 2.0 LICENSE in packages and make releas…

    …e re-runs safe
    
    The repository license moved from LICENSE.md (Elastic 2.0) to LICENSE
    (Apache 2.0), but the npm, Expo, Flutter and Android packaging still
    referenced the old file and license, so the 1.2.1 release stopped at the
    npm step. Point them at LICENSE and declare Apache-2.0.
    
    Let the release job be re-run for a version it already partly published:
    skip the sqlite-wasm and react-native bumps when they are already at the
    version, and skip the Maven Central upload when the version is there.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    andinux and claude committed Nov 6, 2026
    Configuration menu
    Copy the full SHA
    bd9f063 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5c76820 View commit details
    Browse the repository at this point in the history
Loading