Repository navigation
Grandfather data already above the free plan limits - #49
Merged
Merged
Conversation
- The boot save (and any other write) was rejected when the database already had more items than the free plan allows, e.g. `plan-limit:habits:3`, so the app stopped on "could not open local data" and never reached the UI. - Capture the per-table counts before the batch and only reject batches that *increase* a count above its limit. Legacy, synced or previously-Pro data stays editable and can only shrink, while creating beyond the limit is still blocked. - Skip the Rust gating for `atlas.test.db`: the demo seed has 5 habits and was bricking the test mode on mobile. - Do not abort boot when the initial save fails; rendering the loaded snapshot is more useful than the load-error screen.
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.
Why
Opening the iOS build failed with:
initialize()saves the snapshot right after loading it. The Rust freemium backstop compared the absolute row counts with the free limits, so any device that already had more than 3 active habits (old install, data synced from a Pro device, or the demo seed) had every write rejected — including the boot save, which left the app stuck on the load-error screen.What changed
db_batchnow counts the limited tables before running the statements and passes that snapshot tocheck_limits.atlas.test.dbbypasses the gating, sincedemoSnapshot()intentionally has 5 habits and was bricking test mode on mobile.initialize()no longer aborts boot; the loaded snapshot is rendered even if that write fails.Verification
cargo test --manifest-path src-tauri/Cargo.toml --locked(51)npm run checknpm test(273)npm run buildPending manual check on device: reopen the app with the over-limit database, confirm it boots and that editing/deleting works while creating a 4th habit still opens the paywall.