Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(mobile): a client cache wasm version bump counts as a native change (#8097)

Peter Chinman1bc95a6fc6b6
diff --git a/.github/workflows/ios-app-store-release.yml b/.github/workflows/ios-app-store-release.yml
index 90f662c817..14ae40f00c 100644
--- a/.github/workflows/ios-app-store-release.yml
+++ b/.github/workflows/ios-app-store-release.yml
@@ -49,12 +49,17 @@ jobs:
# (the android_* plugins, every android/ directory, android.rs / android.json,
# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
# cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. The release stamps uploaded builds
- # with it, the merge gate compares the live build's stamp against the merge
- # result's, and the drift / head guards compare commits with it. Must match
- # nativeTreeHash() in apps/web/scripts/ios-app-store.mjs and the iOS Native
- # Check path filter (web_app_check_main/ios_native_check.rs).
+ # config. Plus one thing outside that tree: the version of the client cache
+ # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
+ # cache crates natively, and the team bumps that version when a cache change
+ # must ship, so the bump — not every edit under crates/client — is the native
+ # signal. The release stamps uploaded builds with the hash, the merge gate
+ # compares the live build's stamp against the merge result's, and the drift /
+ # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
+ # detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
+ CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
@@ -62,9 +67,18 @@ jobs:
# which would silently hash nothing when run from apps/web.)
native_tree_hash() {
git rev-parse -q --verify "$1:${NATIVE_TREE_PATH}" >/dev/null || return 1
- git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
- | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]' \
- | git hash-object --stdin
+ {
+ git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
+ | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]'
+ echo "cache-wasm-version $(cache_wasm_version "$1")"
+ } | git hash-object --stdin
+ }
+
+ # cache_wasm_version <commit>: the `version` of the client cache wasm package
+ # at that commit ("none" before the package existed).
+ cache_wasm_version() {
+ git show "$1:${CACHE_WASM_MANIFEST}" 2>/dev/null \
+ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none
}
# native_tree_fetch <sha>: make a commit that is not in this checkout (a new
@@ -290,12 +304,17 @@ jobs:
# (the android_* plugins, every android/ directory, android.rs / android.json,
# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
# cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. The release stamps uploaded builds
- # with it, the merge gate compares the live build's stamp against the merge
- # result's, and the drift / head guards compare commits with it. Must match
- # nativeTreeHash() in apps/web/scripts/ios-app-store.mjs and the iOS Native
- # Check path filter (web_app_check_main/ios_native_check.rs).
+ # config. Plus one thing outside that tree: the version of the client cache
+ # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
+ # cache crates natively, and the team bumps that version when a cache change
+ # must ship, so the bump — not every edit under crates/client — is the native
+ # signal. The release stamps uploaded builds with the hash, the merge gate
+ # compares the live build's stamp against the merge result's, and the drift /
+ # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
+ # detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
+ CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
@@ -303,9 +322,18 @@ jobs:
# which would silently hash nothing when run from apps/web.)
native_tree_hash() {
git rev-parse -q --verify "$1:${NATIVE_TREE_PATH}" >/dev/null || return 1
- git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
- | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]' \
- | git hash-object --stdin
+ {
+ git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
+ | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]'
+ echo "cache-wasm-version $(cache_wasm_version "$1")"
+ } | git hash-object --stdin
+ }
+
+ # cache_wasm_version <commit>: the `version` of the client cache wasm package
+ # at that commit ("none" before the package existed).
+ cache_wasm_version() {
+ git show "$1:${CACHE_WASM_MANIFEST}" 2>/dev/null \
+ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none
}
# native_tree_fetch <sha>: make a commit that is not in this checkout (a new
diff --git a/.github/workflows/ios-release-drift.yml b/.github/workflows/ios-release-drift.yml
index e7d140fff0..2b737bebbb 100644
--- a/.github/workflows/ios-release-drift.yml
+++ b/.github/workflows/ios-release-drift.yml
@@ -36,12 +36,17 @@ jobs:
# (the android_* plugins, every android/ directory, android.rs / android.json,
# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
# cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. The release stamps uploaded builds
- # with it, the merge gate compares the live build's stamp against the merge
- # result's, and the drift / head guards compare commits with it. Must match
- # nativeTreeHash() in apps/web/scripts/ios-app-store.mjs and the iOS Native
- # Check path filter (web_app_check_main/ios_native_check.rs).
+ # config. Plus one thing outside that tree: the version of the client cache
+ # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
+ # cache crates natively, and the team bumps that version when a cache change
+ # must ship, so the bump — not every edit under crates/client — is the native
+ # signal. The release stamps uploaded builds with the hash, the merge gate
+ # compares the live build's stamp against the merge result's, and the drift /
+ # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
+ # detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
+ CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
@@ -49,9 +54,18 @@ jobs:
# which would silently hash nothing when run from apps/web.)
native_tree_hash() {
git rev-parse -q --verify "$1:${NATIVE_TREE_PATH}" >/dev/null || return 1
- git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
- | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]' \
- | git hash-object --stdin
+ {
+ git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
+ | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]'
+ echo "cache-wasm-version $(cache_wasm_version "$1")"
+ } | git hash-object --stdin
+ }
+
+ # cache_wasm_version <commit>: the `version` of the client cache wasm package
+ # at that commit ("none" before the package existed).
+ cache_wasm_version() {
+ git show "$1:${CACHE_WASM_MANIFEST}" 2>/dev/null \
+ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none
}
# native_tree_fetch <sha>: make a commit that is not in this checkout (a new
diff --git a/.github/workflows/ios-release-watch.yml b/.github/workflows/ios-release-watch.yml
index 96f8037ca4..6115003ec6 100644
--- a/.github/workflows/ios-release-watch.yml
+++ b/.github/workflows/ios-release-watch.yml
@@ -117,12 +117,17 @@ jobs:
# (the android_* plugins, every android/ directory, android.rs / android.json,
# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
# cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. The release stamps uploaded builds
- # with it, the merge gate compares the live build's stamp against the merge
- # result's, and the drift / head guards compare commits with it. Must match
- # nativeTreeHash() in apps/web/scripts/ios-app-store.mjs and the iOS Native
- # Check path filter (web_app_check_main/ios_native_check.rs).
+ # config. Plus one thing outside that tree: the version of the client cache
+ # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
+ # cache crates natively, and the team bumps that version when a cache change
+ # must ship, so the bump — not every edit under crates/client — is the native
+ # signal. The release stamps uploaded builds with the hash, the merge gate
+ # compares the live build's stamp against the merge result's, and the drift /
+ # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
+ # detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
+ CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
@@ -130,9 +135,18 @@ jobs:
# which would silently hash nothing when run from apps/web.)
native_tree_hash() {
git rev-parse -q --verify "$1:${NATIVE_TREE_PATH}" >/dev/null || return 1
- git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
- | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]' \
- | git hash-object --stdin
+ {
+ git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
+ | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]'
+ echo "cache-wasm-version $(cache_wasm_version "$1")"
+ } | git hash-object --stdin
+ }
+
+ # cache_wasm_version <commit>: the `version` of the client cache wasm package
+ # at that commit ("none" before the package existed).
+ cache_wasm_version() {
+ git show "$1:${CACHE_WASM_MANIFEST}" 2>/dev/null \
+ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none
}
# native_tree_fetch <sha>: make a commit that is not in this checkout (a new
diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.yml
index 630862fb3a..e5aaa0d7bd 100644
--- a/.github/workflows/web-app-check-main.yml
+++ b/.github/workflows/web-app-check-main.yml
@@ -384,9 +384,28 @@ jobs:
- '!apps/web/tauri/**/*.android.*'
- '!apps/web/tauri/desktop-release.json'
- '!apps/web/tauri/.helix/**'
+ - id: cache-wasm
+ name: Detect a client cache wasm version bump
+ run: |
+ set -euo pipefail
+ manifest=crates/client/cache-wasm/Cargo.toml
+ version() { git show "$1:$manifest" 2>/dev/null | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none; }
+ git fetch -q --depth=1 origin "$BASE_BRANCH"
+ base=$(version "origin/$BASE_BRANCH")
+ head=$(version HEAD)
+ echo "cache-wasm version: base ${base}, merge result ${head}"
+ if [[ "$base" != "$head" ]]; then
+ echo "bumped=true" >> "$GITHUB_OUTPUT"
+ echo "The client cache wasm version moved; the native app compiles that cache, so this counts as a native change."
+ else
+ echo "bumped=false" >> "$GITHUB_OUTPUT"
+ fi
+ shell: bash
+ env:
+ BASE_BRANCH: ${{ github.base_ref }}
- id: labels
name: Read the PR's current labels
- if: steps.native-filter.outputs.ios_native == 'true'
+ if: (steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true')
run: |
set -euo pipefail
labels=$(gh pr view "$PR_NUMBER" --repo "$GH_REPO" --json labels --jq '[.labels[].name] | join(",")')
@@ -402,12 +421,12 @@ jobs:
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Setup Bun
- if: steps.native-filter.outputs.ios_native == 'true' && steps.labels.outputs.skip != 'true'
+ if: (steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true') && steps.labels.outputs.skip != 'true'
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: '1.3.13'
- name: Verify iOS release numbers were bumped
- if: steps.native-filter.outputs.ios_native == 'true' && steps.labels.outputs.skip != 'true'
+ if: (steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true') && steps.labels.outputs.skip != 'true'
run: |
set -euo pipefail
git fetch --depth=1 origin "$BASE_BRANCH"
@@ -418,7 +437,7 @@ jobs:
BASE_REF: origin/${{ github.base_ref }}
working-directory: apps/web
- name: Fetch App Store Connect credentials from Doppler
- if: steps.native-filter.outputs.ios_native == 'true' && steps.labels.outputs.skip != 'true'
+ if: (steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true') && steps.labels.outputs.skip != 'true'
run: |
set -euo pipefail
# Fetch the App Store Connect credentials from Doppler (ios-release/prd) —
@@ -483,7 +502,7 @@ jobs:
env:
DOPPLER_TOKEN: ${{ secrets.IOS_RELEASE_DOPPLER_TOKEN }}
- name: Require the App Store release to be live
- if: steps.native-filter.outputs.ios_native == 'true' && steps.labels.outputs.skip != 'true'
+ if: (steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true') && steps.labels.outputs.skip != 'true'
run: |
# --- native tree ------------------------------------------------------------
# Hash identifying "the iOS native code" at a commit: every tracked blob under
@@ -493,12 +512,17 @@ jobs:
# (the android_* plugins, every android/ directory, android.rs / android.json,
# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
# cfg(target_os = "android")) — plus the desktop updater manifest and editor
- # config. The release stamps uploaded builds
- # with it, the merge gate compares the live build's stamp against the merge
- # result's, and the drift / head guards compare commits with it. Must match
- # nativeTreeHash() in apps/web/scripts/ios-app-store.mjs and the iOS Native
- # Check path filter (web_app_check_main/ios_native_check.rs).
+ # config. Plus one thing outside that tree: the version of the client cache
+ # wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
+ # cache crates natively, and the team bumps that version when a cache change
+ # must ship, so the bump — not every edit under crates/client — is the native
+ # signal. The release stamps uploaded builds with the hash, the merge gate
+ # compares the live build's stamp against the merge result's, and the drift /
+ # head guards compare commits with it. Must match nativeTreeHash() in
+ # apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
+ # detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
+ CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
@@ -506,9 +530,18 @@ jobs:
# which would silently hash nothing when run from apps/web.)
native_tree_hash() {
git rev-parse -q --verify "$1:${NATIVE_TREE_PATH}" >/dev/null || return 1
- git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
- | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]' \
- | git hash-object --stdin
+ {
+ git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
+ | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]'
+ echo "cache-wasm-version $(cache_wasm_version "$1")"
+ } | git hash-object --stdin
+ }
+
+ # cache_wasm_version <commit>: the `version` of the client cache wasm package
+ # at that commit ("none" before the package existed).
+ cache_wasm_version() {
+ git show "$1:${CACHE_WASM_MANIFEST}" 2>/dev/null \
+ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none
}
# native_tree_fetch <sha>: make a commit that is not in this checkout (a new
@@ -556,7 +589,7 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
working-directory: apps/web
- name: Skipped via label
- if: steps.native-filter.outputs.ios_native == 'true' && steps.labels.outputs.skip == 'true'
+ if: (steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true') && steps.labels.outputs.skip == 'true'
run: echo "Native iOS changes detected, but the skip-ios-update label says they don't break the native/web contract — skipping the App Store release gate."
status-check:
needs:
diff --git a/apps/web/docs/ios-releases.md b/apps/web/docs/ios-releases.md
index d4b0d03cc7..a2f7d80659 100644
--- a/apps/web/docs/ios-releases.md
+++ b/apps/web/docs/ios-releases.md
@@ -15,8 +15,8 @@ checked-in `min-native-build.json` enforce this end to end.
1. **`iOS Native Check`**, a job of the web app PR checks
(`.github/workflows/web-app-check-main.yml`), runs on every PR against
`main`. The required `Web App Status Check` depends on it, so no branch
- ruleset change is needed. If the PR touches the iOS native code it
- requires:
+ ruleset change is needed. If the PR touches the iOS native code (see
+ "What counts as native code" below) it requires:
- the iOS release numbers to be bumped relative to `main`, and
- that exact version + build to be **live on the App Store**.
@@ -91,19 +91,39 @@ finish first (up to 25 minutes), and the release preconditions ignore it. For a
to ship to the App Store, `just ios-bump --no-min` bumps the versions without
raising the floor.
+## What counts as native code
+
+Two things:
+
+- **`apps/web/tauri`**, minus what never reaches the iOS binary: anything
+ Android-only by Tauri's naming convention (a path component `android`,
+ `android_*`, `android.*` or `*.android.*` — the `android_*` plugins, every
+ `android/` directory, `android.rs`, `tauri.android.conf.json` and so on),
+ `desktop-release.json`, and `.helix/`.
+- **A bump of the client cache wasm package version** in
+ `crates/client/cache-wasm/Cargo.toml`. The app compiles the cache crates
+ (`crates/client/cache-core`, `cache-turso` and what they pull in)
+ natively through the GraphQL cache plugin, so a cache change ships to
+ iOS only through the App Store. Rather than treating every edit under
+ `crates/client` as native, the gate uses the version the team already
+ bumps when a cache change must ship: a PR that moves it (compared with
+ the base branch on the merge ref) is a native PR, and the version is part
+ of the provenance hash, so a build is only "live" for the version it was
+ built with. The Android release workflow applies the same rule when it
+ decides whether a production release needs a new App Bundle
+ (`scripts/android-release-needed.mjs`).
+
+The hash recipe is defined once, in `scripts/ios_native_tree.sh` next to the
+workflow sources, mirrored in `ios-app-store.mjs`; the gate's change
+detection uses the same exclusions and the same version comparison.
+
## Several native PRs at once
Version + build number alone don't identify a PR's native code: two PRs
bumped from the same `main` get the same numbers. So the release stamps each
uploaded build with a hash of the native code it was built from (in the
build's TestFlight "What to Test" text), and the checks use it. "Native
-code" is everything under `apps/web/tauri` except what never reaches the iOS
-binary: anything Android-only by Tauri's naming convention (a path component
-`android`, `android_*`, `android.*` or `*.android.*` — the `android_*`
-plugins, every `android/` directory, `android.rs`, `tauri.android.conf.json`
-and so on), `desktop-release.json`, and `.helix/`. The rule is defined once,
-in `scripts/ios_native_tree.sh` next to the workflow sources, mirrored in
-`ios-app-store.mjs` and the gate's path filter. The checks:
+code" is defined above. The checks:
- **Collision check** (release workflow, before building): the
marketing version must be above the latest App Store release, and a
diff --git a/apps/web/scripts/android-release-needed.mjs b/apps/web/scripts/android-release-needed.mjs
index c30c6766c9..38e084abe7 100644
--- a/apps/web/scripts/android-release-needed.mjs
+++ b/apps/web/scripts/android-release-needed.mjs
@@ -4,6 +4,10 @@ import { resolve } from 'node:path';
import { pathToFileURL } from 'node:url';
const tauriPath = 'apps/web/tauri';
+// The app compiles the client cache crates natively; the team bumps this
+// package's version when a cache change must ship, so a bump counts as a
+// native change (other edits under crates/client do not).
+const cacheWasmManifest = 'crates/client/cache-wasm/Cargo.toml';
const releaseTag = /^v20\d{2}\.\d{1,2}\.\d{1,2}(?:\.\d{1,2})?$/;
export function androidReleaseDecision({ releases, cwd = process.cwd() }) {
@@ -15,6 +19,17 @@ export function androidReleaseDecision({ releases, cwd = process.cwd() }) {
}).trim();
const head = git('rev-parse', '--verify', 'HEAD^{commit}');
const tree = git('rev-parse', '--verify', `${head}:${tauriPath}`);
+ const cacheWasmVersion = (commit) => {
+ try {
+ return (
+ git('show', `${commit}:${cacheWasmManifest}`).match(
+ /^version\s*=\s*"([^"]*)"/m
+ )?.[1] ?? 'none'
+ );
+ } catch {
+ return 'none'; // the package did not exist at this commit
+ }
+ };
const candidates = new Map();
for (const release of releases) {
const tag = release.tag_name;
@@ -49,12 +64,24 @@ export function androidReleaseDecision({ releases, cwd = process.cwd() }) {
};
}
const tag = candidates.get(baseline);
- if (tree === git('rev-parse', '--verify', `${baseline}:${tauriPath}`)) {
+ const tauriChanged =
+ tree !== git('rev-parse', '--verify', `${baseline}:${tauriPath}`);
+ const cacheBumped = cacheWasmVersion(head) !== cacheWasmVersion(baseline);
+ if (!tauriChanged && !cacheBumped) {
return {
build: false,
- summary: `Skip Android: ${tauriPath}/ is unchanged since ${tag}. App updates use the bundle updater.`,
+ summary: `Skip Android: ${tauriPath}/ and the client cache wasm version are unchanged since ${tag}. App updates use the bundle updater.`,
};
}
+ // The version code bump itself lives under the Tauri directory, so name
+ // the cache bump too when that is what the release is really for.
+ const reason = [
+ tauriChanged && `${tauriPath}/ changed since ${tag}`,
+ cacheBumped &&
+ `the client cache wasm version moved since ${tag} (${cacheWasmVersion(baseline)} → ${cacheWasmVersion(head)})`,
+ ]
+ .filter(Boolean)
+ .join(' and ');
const versionCode = (commit) => {
const config = JSON.parse(
@@ -67,12 +94,12 @@ export function androidReleaseDecision({ releases, cwd = process.cwd() }) {
};
if (versionCode(head) <= versionCode(baseline)) {
throw new Error(
- `Tauri changed since ${tag}, but Android versionCode did not increase. Run just android-bump in apps/web and commit before tagging.`
+ `Native code changed (${reason}), but Android versionCode did not increase. Run just android-bump in apps/web and commit before tagging.`
);
}
return {
build: true,
- summary: `Build Android: ${tauriPath}/ changed since ${tag}.`,
+ summary: `Build Android: ${reason}.`,
};
}
diff --git a/apps/web/scripts/android-release-needed.test.ts b/apps/web/scripts/android-release-needed.test.ts
index f10b5f6890..6a559cac02 100644
--- a/apps/web/scripts/android-release-needed.test.ts
+++ b/apps/web/scripts/android-release-needed.test.ts
@@ -108,6 +108,52 @@ describe('native release detection', () => {
);
});
+ const cacheWasm = (version: string, extra = '') =>
+ write(
+ 'crates/client/cache-wasm/Cargo.toml',
+ `[package]\nname = "cache-wasm"\nversion = "${version}"\n${extra}`
+ );
+
+ it('builds when the client cache wasm version moves, with a new version code', () => {
+ cacheWasm('0.6.1');
+ commit();
+ const baseline = release();
+ cacheWasm('0.6.2');
+ write('crates/client/cache-core/src/lib.rs', '// cache change');
+ version(2);
+ commit();
+ expect(androidReleaseDecision({ cwd, releases: [baseline] })).toEqual({
+ build: true,
+ summary: expect.stringContaining(
+ 'the client cache wasm version moved since v2026.10.1 (0.6.1 → 0.6.2)'
+ ),
+ });
+ });
+
+ it('rejects a client cache wasm version bump without a new version code', () => {
+ cacheWasm('0.6.1');
+ commit();
+ const baseline = release();
+ cacheWasm('0.6.2');
+ commit();
+ expect(() => androidReleaseDecision({ cwd, releases: [baseline] })).toThrow(
+ /versionCode/
+ );
+ });
+
+ it('skips client cache changes that do not move the wasm version', () => {
+ cacheWasm('0.6.1');
+ commit();
+ const baseline = release();
+ cacheWasm('0.6.1', '[dependencies]\nserde = "1"\n');
+ write('crates/client/cache-core/src/lib.rs', '// cache change');
+ write('crates/client/cache-turso/src/lib.rs', '// storage change');
+ commit();
+ expect(androidReleaseDecision({ cwd, releases: [baseline] }).build).toBe(
+ false
+ );
+ });
+
it('detects deleted native files', () => {
const baseline = release();
rmSync(join(cwd, 'apps/web/tauri/src-tauri/src/lib.rs'));
diff --git a/apps/web/scripts/ios-app-store.mjs b/apps/web/scripts/ios-app-store.mjs
index 26aeafa2d9..24af988d18 100644
--- a/apps/web/scripts/ios-app-store.mjs
+++ b/apps/web/scripts/ios-app-store.mjs
@@ -128,10 +128,14 @@ const BOOLEAN_FLAGS = new Set(["require-live", "require-unused-build"]);
/// "The native code": every tracked blob under this directory except what
/// never reaches the iOS binary — anything Android-only by Tauri's naming
/// convention (a path component `android`, `android_*`, `android.*` or
-/// `*.android.*`), the desktop updater manifest, editor config. Must match
-/// `native_tree_hash` in tooling/xtask/.../workflows/scripts/ios_native_tree.sh
-/// and the iOS Native Check path filter.
+/// `*.android.*`), the desktop updater manifest, editor config — plus the
+/// version of the client cache wasm package, which the team bumps when a
+/// cache change must ship (the app compiles the cache crates natively). Must
+/// match `native_tree_hash` in
+/// tooling/xtask/.../workflows/scripts/ios_native_tree.sh and the iOS Native
+/// Check's change detection.
const NATIVE_TREE_PATH = "apps/web/tauri";
+const CACHE_WASM_MANIFEST = "crates/client/cache-wasm/Cargo.toml";
const NATIVE_TREE_EXCLUDE = /(^|\/)android([_.\/]|$)|\.android\.|^desktop-release\.json$|^\.helix\//;
const STAMP_RE = /native tree ([0-9a-f]{40})/;
const STAMP_PR_RE = /for PR #(\d+)/;
@@ -197,7 +201,14 @@ function nativeTreeHash() {
.filter((line) => line && !NATIVE_TREE_EXCLUDE.test(line.split("\t")[1]))
.map((line) => `${line}\n`)
.join("");
- return git(["hash-object", "--stdin"], listing).trim();
+ let cacheWasmVersion = "none";
+ try {
+ cacheWasmVersion =
+ git(["show", `HEAD:${CACHE_WASM_MANIFEST}`]).match(/^version *= *"([^"]*)"/m)?.[1] ?? "none";
+ } catch {
+ // The package did not exist at this commit.
+ }
+ return git(["hash-object", "--stdin"], `${listing}cache-wasm-version ${cacheWasmVersion}\n`).trim();
} catch {
return null;
}
diff --git a/docs/development/android.md b/docs/development/android.md
index 2726764d6b..f42bc05605 100644
--- a/docs/development/android.md
+++ b/docs/development/android.md
@@ -143,10 +143,15 @@ only when `apps/web/tauri/` differs from the closest ancestor release with a
complete AAB, R8 mapping, and checksums. The first release without
such a baseline builds an AAB. Frontend-only releases skip native builds and Play
uploads; their app updates use the bundle updater. The comparison covers the
-entire Tauri directory, including Android, iOS, Rust, and native config files.
-Changes outside that directory do not trigger a native release. If an external
-dependency or build-script change needs a new binary, bump the native version code
-in the Tauri directory as part of that change.
+entire Tauri directory, including Android, iOS, Rust, and native config files,
+plus one signal outside it: the `version` of the client cache wasm package in
+`crates/client/cache-wasm/Cargo.toml`. The app compiles the client cache
+crates natively, and the team bumps that version when a cache change must
+ship, so a bump since the baseline release counts as a native change (other
+edits under `crates/client` do not). Other changes outside the Tauri
+directory do not trigger a native release. If an external dependency or
+build-script change needs a new binary, bump the native version code in the
+Tauri directory as part of that change.
Failed/incomplete artifact uploads do not advance the baseline. A rerun whose
release already has complete artifacts skips rebuilding; retry a failed Play
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh
index 22e5ec5866..290b4f4c77 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/ios_native_tree.sh
@@ -6,12 +6,17 @@
# (the android_* plugins, every android/ directory, android.rs / android.json,
# android_tls.rs, tauri.android.conf.json; the Rust ones are all behind
# cfg(target_os = "android")) — plus the desktop updater manifest and editor
-# config. The release stamps uploaded builds
-# with it, the merge gate compares the live build's stamp against the merge
-# result's, and the drift / head guards compare commits with it. Must match
-# nativeTreeHash() in apps/web/scripts/ios-app-store.mjs and the iOS Native
-# Check path filter (web_app_check_main/ios_native_check.rs).
+# config. Plus one thing outside that tree: the version of the client cache
+# wasm package (crates/client/cache-wasm/Cargo.toml). The app compiles the
+# cache crates natively, and the team bumps that version when a cache change
+# must ship, so the bump — not every edit under crates/client — is the native
+# signal. The release stamps uploaded builds with the hash, the merge gate
+# compares the live build's stamp against the merge result's, and the drift /
+# head guards compare commits with it. Must match nativeTreeHash() in
+# apps/web/scripts/ios-app-store.mjs and the iOS Native Check's change
+# detection (web_app_check_main/ios_native_check.rs).
NATIVE_TREE_PATH=apps/web/tauri
+CACHE_WASM_MANIFEST=crates/client/cache-wasm/Cargo.toml
export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.json$|^\.helix/'
# native_tree_hash <commit>: prints the hash, fails if the path is missing.
@@ -19,9 +24,18 @@ export NATIVE_TREE_EXCLUDE='(^|/)android([_./]|$)|\.android\.|^desktop-release\.
# which would silently hash nothing when run from apps/web.)
native_tree_hash() {
git rev-parse -q --verify "$1:${NATIVE_TREE_PATH}" >/dev/null || return 1
- git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
- | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]' \
- | git hash-object --stdin
+ {
+ git ls-tree -r --full-tree "$1:${NATIVE_TREE_PATH}" \
+ | awk -F'\t' '$2 !~ ENVIRON["NATIVE_TREE_EXCLUDE"]'
+ echo "cache-wasm-version $(cache_wasm_version "$1")"
+ } | git hash-object --stdin
+}
+
+# cache_wasm_version <commit>: the `version` of the client cache wasm package
+# at that commit ("none" before the package existed).
+cache_wasm_version() {
+ git show "$1:${CACHE_WASM_MANIFEST}" 2>/dev/null \
+ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none
}
# native_tree_fetch <sha>: make a commit that is not in this checkout (a new
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs
index c349228c1a..add0c003b8 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main/ios_native_check.rs
@@ -5,12 +5,17 @@
//! the App Store, so a PR whose bundle depends on new native code must not
//! merge before that native build is actually downloadable. The gate:
//!
-//! 1. Detects native changes with a path filter over `apps/web/tauri/**`,
+//! 1. Detects native changes: a path filter over `apps/web/tauri/**`,
//! minus what never reaches the iOS binary (anything Android-only by
//! name, the desktop updater manifest, editor config) — the same
-//! exclusions as the native tree hash in `scripts/ios_native_tree.sh`.
-//! The filter needs dorny's `every` quantifier: with the default `some`
-//! a negated pattern matches every file outside it, i.e. everything.
+//! exclusions as the native tree hash in `scripts/ios_native_tree.sh` —
+//! or a bump of the client cache wasm package version
+//! (`crates/client/cache-wasm/Cargo.toml`): the app compiles the cache
+//! crates natively, and that version is the team's "this cache change
+//! must ship" signal, so the bump counts as native while other edits
+//! under `crates/client` don't. The filter needs dorny's `every`
+//! quantifier: with the default `some` a negated pattern matches every
+//! file outside it, i.e. everything.
//! 2. Verifies the PR bumped the iOS release numbers (`just ios-bump`):
//! marketing version, build number, and `min-native-build.json`.
//! 3. Asks the App Store Connect API whether exactly that version + build is
@@ -42,8 +47,9 @@ pub(super) const JOB_ID: &str = "ios-native-check";
/// The job's display name (a check run name).
pub(super) const JOB_NAME: &str = "iOS Native Check";
-/// The path filter matched native iOS code.
-const NATIVE_CHANGED: &str = "steps.native-filter.outputs.ios_native == 'true'";
+/// Native iOS code changed: the path filter matched, or the cache wasm
+/// version moved against the base branch.
+const NATIVE_CHANGED: &str = "(steps.native-filter.outputs.ios_native == 'true' || steps.cache-wasm.outputs.bumped == 'true')";
/// The PR opted out of the gate via the `skip-ios-update` label (as read at
/// run time, see [`read_labels`]), and its negation. Spelled out rather than
/// `!SKIP_LABEL`: in GitHub expressions `!` binds tighter than `==`, so
@@ -65,6 +71,7 @@ pub(super) fn job() -> Job {
// the base branch itself, only when it runs.
.add_step(super::checkout("Checkout Repo", false))
.add_step(paths_filter())
+ .add_step(cache_wasm_version_bump())
.add_step(read_labels())
.add_step(setup_bun())
.add_step(verify_bump())
@@ -102,6 +109,31 @@ fn paths_filter() -> Step<Use> {
))
}
+/// Did this PR move the client cache wasm package version against its base?
+/// Compared on the merge ref, so a bump that already landed on main does not
+/// count. Fetches the base branch (shallow) for the comparison.
+fn cache_wasm_version_bump() -> Step<Run> {
+ Step::new("Detect a client cache wasm version bump")
+ .run(indoc::indoc! {r#"
+ set -euo pipefail
+ manifest=crates/client/cache-wasm/Cargo.toml
+ version() { git show "$1:$manifest" 2>/dev/null | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1 | grep . || echo none; }
+ git fetch -q --depth=1 origin "$BASE_BRANCH"
+ base=$(version "origin/$BASE_BRANCH")
+ head=$(version HEAD)
+ echo "cache-wasm version: base ${base}, merge result ${head}"
+ if [[ "$base" != "$head" ]]; then
+ echo "bumped=true" >> "$GITHUB_OUTPUT"
+ echo "The client cache wasm version moved; the native app compiles that cache, so this counts as a native change."
+ else
+ echo "bumped=false" >> "$GITHUB_OUTPUT"
+ fi
+ "#})
+ .id("cache-wasm")
+ .shell("bash")
+ .add_env(("BASE_BRANCH", "${{ github.base_ref }}"))
+}
+
/// The PR's labels as they are now. `github.event.pull_request.labels` is
/// frozen at the event that started the run, so after the label workflow
/// re-runs this job it would still describe the old label set.