ci: static check for Adapty fallback paywalls format version#1058
Merged
Conversation
Bundled Adapty fallback JSONs encode their format version at meta.version.
When the SDK is upgraded past the format the bundled JSONs were exported
for, the SDK rejects them on every cold start with error 2006 ("Decoding
Fallback Paywalls failed... The fallback paywalls version is not correct"),
which is silently swallowed by the Dart catch in
common/lib/src/features/payment/domain/adapty.dart and ultimately surfaces
to users as StageModal.paymentTempUnavailable when the live getPaywall()
call also fails.
Adds a tiny Node script + GitHub Actions workflow that asserts every
bundled fallback JSON has meta.version >= MIN_VERSION (currently 9, which
matches SDK 3.15.x). When Adapty bumps the format alongside an SDK
upgrade, bump MIN_VERSION in the same PR that refreshes the JSONs.
Runs on Ubuntu in ~5s on PRs that touch the fallback files or the SDK
deps, no device, no Appium, no entitlements. Supersedes #1056 — see that
PR for the (failed) attempts at runtime detection that drove the pivot.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a lightweight CI guard to prevent Adapty fallback paywalls JSON bundles from silently drifting behind the minimum meta.version required by the shipped Adapty SDK.
Changes:
- Introduces
scripts/check-adapty-fallback-version.mjsto validatemeta.version >= MIN_VERSIONacross the three bundled fallback JSON files. - Adds a GitHub Actions workflow to run the check on PRs that touch fallback bundles, selected dependency lockfiles, or the check script itself.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/check-adapty-fallback-version.mjs |
Node script that parses bundled fallback paywalls JSON files and enforces a minimum meta.version. |
.github/workflows/check-adapty-fallback.yml |
CI workflow that runs the script on PRs/main pushes (with path filtering on PRs). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+12
| paths: | ||
| - "common/assets/fallbacks/**" | ||
| - "android/app/src/main/assets/fallbacks/**" | ||
| - "common/pubspec.yaml" | ||
| - "common/pubspec.lock" | ||
| - "ios/Podfile.lock" | ||
| - "scripts/check-adapty-fallback-version.mjs" | ||
| - ".github/workflows/check-adapty-fallback.yml" |
Contributor
Author
|
Red on this new Adapty fallback version check is expected here, another PR will fix it (actual paywall fallback update). Check should be green then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/check-adapty-fallback-version.mjs) that reads each of the three bundled Adapty fallback JSONs (common/assets/fallbacks/{ios,android}.json+android/app/src/main/assets/fallbacks/android.json) and assertsmeta.version >= MIN_VERSION(currently9)..github/workflows/check-adapty-fallback.yml) that runs the script on Ubuntu in ~5s on PRs that touch the fallback files, the Adapty deps, or the script itself.Why
Adapty SDK 3.15.7 was rejecting the bundled JSONs (
meta.version: 8) at every cold start with error 2006 — "Decoding Fallback Paywalls failed... The fallback paywalls version is not correct." The Dart catch atcommon/lib/src/features/payment/domain/adapty.dart:39swallows that error with a debug-level "ignore" log, so the bundled JSON went silently stale for months. When the livegetPaywall()call also failed, the user ended up atStageModal.paymentTempUnavailable.This catches it before merge with a deterministic signal — the format version is encoded in the file itself.
Why this approach (and not the Appium smoke from #1056)
#1056 attempted runtime detection from the Appium smoke test. Three runtime approaches were tried; all of them hit blockers that needed either developer provisioning, runner-dependent device behavior, or a new entitlement we don't want. See the close comment on #1056 for the full trail.
The static check has one limitation worth flagging: it only catches version-encoded staleness. If Adapty ever changed the format without bumping
meta.version, we'd miss it. In practice that field is literally the format version, so this is fine.When Adapty's format bumps with a future SDK upgrade, the same PR that refreshes the JSONs bumps
MIN_VERSIONin the script.Verified locally
main(meta.version: 8): script exits 1 with three clear FAIL lines pointing at the three JSONs.meta.version: 9): script exits 0 with three OK lines.Test plan
mainstill has v8 JSONs).MIN_VERSIONtogether passes; one that only does one of those fails.🤖 Generated with Claude Code