-
Notifications
You must be signed in to change notification settings - Fork 145
Debugging #1047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Debugging #1047
Conversation
Adds console.log statements to trace the flow of data when rows move into scope in on-demand mode with subset filtering. Key areas logged: - SYNC_START: Collection sync initialization (mode, offset, table, where) - STREAM: All incoming message batches and individual message types - CHANGE: Every change message with operation, row ID, existing state, tags - MOVE-IN: Detection of rows receiving their first tags - MOVE-OUT: Move-out event processing and row deletion - TAGS: Tag addition/removal with before/after counts - LOAD_SUBSET: Snapshot requests and responses - STATE: Insert/update/delete operations with data merging details Critical warnings are logged when: - UPDATE received for non-existent row (potential partial data bug) - Move-in row has undefined values To use: Run the app and check console for [DEBUG] prefixed logs.
Additional logging added to cover all code paths: - BUFFERING: When messages are buffered in progressive mode - TX: All transaction begin/commit points - SNAPSHOT_END/SUBSET_END: Control message handling - UP_TO_DATE: When up-to-date is received - MUST_REFETCH: When must-refetch triggers truncate - ATOMIC_SWAP: All steps of progressive mode atomic swap - BATCH_END: Summary at end of each message batch - READY: When collection is marked ready - LOAD_SUBSET: Cursor-based pagination requests - TAGS: All tag operations (add, remove, clear, match) - addTagsToRow with tag details - removeTagsFromRow with tag details - removeMatchingTagsFromRow with before/after counts - clearTagsForRow and clearTagTrackingState
Additional logging for remaining code paths: - CLEANUP: When collection cleanup is called - ERROR: When ShapeStream errors occur - STATE TRUNCATE: Before/after truncate with sizes - STATE COMMIT: Final commit summary with sizes - LOAD_SUBSET: More detail on cursor pagination - TAGS: All tag operation entry/exit points This covers all major code paths for debugging the move-in bug.
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: +342 B (+0.38%) Total Size: 89.8 kB
βΉοΈ View Unchanged
|
|
Size Change: 0 B Total Size: 3.35 kB βΉοΈ View Unchanged
|
π― Changes
β Checklist
pnpm test:pr.π Release Impact