fix(changes): actionable error when settings exist but *_cloudsync tables are missing#55
Merged
Merged
Conversation
…bles are missing Querying cloudsync_changes on a database whose cloudsync_table_settings rows survived while every *_cloudsync meta table was lost (e.g. a dump/restore that skipped them) returned SQLITE_NOMEM: the NULL from vtab_build_changes_sql fell through the config-exists guard and was reported by SQLite Cloud as "Not enough memory to execute query" on the /check path, pointing operators at memory instead of the real state. - xFilter now distinguishes this state (settings rows present, zero %_cloudsync tables in sqlite_master) and raises "cloudsync settings reference tables whose sync metadata is missing" with the re-init remediation; genuine OOM still returns SQLITE_NOMEM - unit test: Changes Vtab Missing Meta Tables (red before, green after) - bump CLOUDSYNC_VERSION to 1.1.2 and add the CHANGELOG entry (SQLite vtab only, no PG changes, extension version stays 1.1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Querying
cloudsync_changes(directly or viacloudsync_payload_blob_checked()) on a database whosecloudsync_table_settingsrows survived while every*_cloudsyncmeta table was lost — e.g. a dump/restore that skipped them — returnedSQLITE_NOMEM: the NULL fromvtab_build_changes_sqlfell through the config-exists guard added in #54. SQLite Cloud reported it on the/checkpath as10000 Not enough memory to execute query, pointing operators at memory instead of the real state (observed in production while diagnosing a customer node).Fix
cloudsync_changesvtab_filternow distinguishes the state: settings rows present but zero%_cloudsynctables insqlite_masterraisesGenuine OOM (at least one meta table exists) still returns
SQLITE_NOMEM.Testing
SQLITE_ERRORwith the actionable message. Red before the fix, green after.out of memory (7).SQLite vtab only — no PostgreSQL changes, extension version stays 1.1. Bumps
CLOUDSYNC_VERSIONto 1.1.2 with CHANGELOG entry.🤖 Generated with Claude Code