Skip to content
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

Undefined is now treated as null https://github.com/pubkey/rxdb/issue… #5423

Closed
wants to merge 3 commits into from

Conversation

1yasa
Copy link

@1yasa 1yasa commented Dec 24, 2023

This PR contains:

A unit test of [email protected] for inserting a undefined value(this value is optional), rxdb will throw error cause by rxdb tranformed value to null.

Describe the problem you have without this PR

#5414

@pubkey
Copy link
Owner

pubkey commented Dec 25, 2023

Your test throws a conflict error which is correct because at the second insert the document already exists.

@1yasa
Copy link
Author

1yasa commented Dec 26, 2023

Your test throws a conflict error which is correct because at the second insert the document already exists.

I tested non-CRDT insertion, insertCRDT in CRDT mode, and regular insert in CRDT mode. The test results indicate that the first two methods meet expectations, but the result of insert in CRDT mode is incorrect.

截屏2023-12-26 15 07 23

pubkey added a commit that referenced this pull request Jan 2, 2024
@pubkey
Copy link
Owner

pubkey commented Jan 2, 2024

Since RxDB v15 we use the mingo library for the nosql-updates. It seems that mingo strips away fields with undefined or replaces the value with null.
So this was causing the dev-mode check to throw an error because the outcoming documents where not equal.

I added a fix for the check here: #5445
However you might want to do a PR to the mingo lib to ensure correct merging of undefined fields.

@1yasa
Copy link
Author

1yasa commented Jan 3, 2024

Since RxDB v15 we use the mingo library for the nosql-updates. It seems that mingo strips away fields with undefined or replaces the value with null. So this was causing the dev-mode check to throw an error because the outcoming documents where not equal.

I added a fix for the check here: #5445 However you might want to do a PR to the mingo lib to ensure correct merging of undefined fields.

🙏

@1yasa 1yasa closed this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants