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

A bug report about $lt selector on primaryKey on RxStorageDexie #4751

Closed
wants to merge 1 commit into from

Conversation

youxkei
Copy link

@youxkei youxkei commented May 28, 2023

This PR contains:

  • BUG REPORT

Describe the problem you have without this PR

There seems a bug for $lt selector on primaryKey on RxStorageDexie.

Comment on lines +126 to 132
const myDocuments = await collectionInOtherTab.mycollection
.find({
selector: {
passportId: { $lt: '002' },
},
})
.exec();
Copy link
Author

@youxkei youxkei May 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

myDocuments should have only alice's passport because we have a selector passportId: { $lt: '002' }.

Comment on lines +138 to +148
assert.deepStrictEqual(
myDocuments.map((doc) => doc.toJSON()),
[
{
passportId: '001',
firstName: 'Alice',
lastName: 'Kelso',
age: 56,
},
]
);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run test:browser:dexie says

  bug-report.test.js
    ✗ should fail because it reproduces the bug
        Expected values to be strictly deep-equal:
        + actual - expected

          [ { passportId: '001',
              firstName: 'Alice',
              lastName: 'Kelso',
        +     age: 56 },
        +   { passportId: '002',
        +     firstName: 'Bob',
        +     lastName: 'Kelso',
        +     age: 45 } ]
        -     age: 56 } ]

@pubkey
Copy link
Owner

pubkey commented Jul 17, 2023

@youxkei please rebase with master. This is likely already fixed.

@youxkei youxkei force-pushed the bug-storage-dexie-lt-on-pk branch from 636e372 to 71b51f1 Compare July 18, 2023 04:15
@youxkei
Copy link
Author

youxkei commented Jul 18, 2023

@pubkey Thank you for your work! I rebased it.

@pubkey
Copy link
Owner

pubkey commented Aug 21, 2023

Working on a fix in #4891
This is not only broken on the dexie storage but also on others.

@pubkey
Copy link
Owner

pubkey commented Aug 21, 2023

Fixed here #4891

@pubkey pubkey closed this Aug 21, 2023
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.

None yet

2 participants