Debugging - #1047
Debugging #1047KyleAMathews wants to merge 5 commits into
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
|
|
Closing as superseded on current main. Against pinned origin/main , a deterministic independent-model probe covering tagged insert → last-route move-out → partial update without baseline → silent move-in is GREEN, while its hostile mutant fails first at the partial-update step. The same-path regressions in and the generated Electric invalid-resume oracle are also GREEN. The underlying lifecycle/resume work landed in #1785 (); this diagnostics-only branch is now stale. Preserving Kyle Mathews/Claude credit and the logging ideas in the Electric lifecycle/oracle cluster. |
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact