-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Composite Primary Keys broken on replicated collections #4190
Conversation
This is a work in progress - I wanted to check if the unit tests actually work. I hope it is ok that I already opened the pull request. |
@pubkey the bug reproduction is finished. |
Test looks ok, however this is intentional. RxDB expects the remote to only send documents that exactly match the schema, so the primary key cannot be missing. |
I find it odd that the behaviour is different for data coming through replication vs. data coming through I thought the logic behind supporting composite primary keys in general was to make it compatible with backend data models - in my case a postgres database - but the composite key behaviour of the backend is not directly compatible with rxdb (concatinating two strings with a separator). Anyways, I'd be interested to add this if you can give me a little hint where the change would make sense. |
You are totally right, the current behavior is not correct. I just wanted to tell you that, so you do not have to look at error at your side.
If you want to fix that, it should be done in the |
@pubkey I just wanted to start working on this and saw you closed this with a fix! Thank you! |
@peterkey |
BUG REPLICATION
Describe the problem you have without this PR
When documents are added to a collection with a composite primary key through the pull handler of a replication, the resulting composite primary key is accessed before it is generated.