-
Notifications
You must be signed in to change notification settings - Fork 102
rxdb-db-collection fixes #667
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?
rxdb-db-collection fixes #667
Conversation
Replaces generic 'any' types with more specific types such as 'Subscription' and 'Record<string, unknown>' for improved type safety. Removes unnecessary type assertions and updates function signatures and variable declarations accordingly.
Added '_deleted': false to query selectors to ensure only non-deleted documents are included during synchronization. This improves data consistency by excluding soft-deleted records from sync operations.
|
Updated the stripRxdbFields function to use a stricter type for the input parameter and removed unnecessary handling for arrays and nullish values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @daveycodez
Would it be possible to add a test that validates the delete behaviour?
Seems like a complex test that would need to run in the web browser and then refresh the page to verify. It requires access to localStorage. The issue was that it loads the data and skips rxdb query and runs directly on the storage instance which skips rxdb filtering out deleted documents. |
Added 'rxjs' with version >=7.8.2 to peerDependencies in package.json to ensure compatibility and proper dependency management.
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-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: |
This PR addresses the majority of "any" type usage in the rxdb-db-collection adapter as well as fixes for only querying documents where _deleted is false, which fixes issues when using localStorage or other persistent storage mechanisms.
Fixes #630