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

Bug example: key compression enabled with boolean indexes on dexie #6267

Conversation

gizm0bill
Copy link

Hello,
I'm opening this PR to demo a bug regarding key compression and boolean indexes with dexie storage.
So when key compression is added and there are some boolean indexes defined in the schema, no results are returned when using that index in a query.
The problem basically boils down to the compression flag and from/toStorage "dance" when inserting and querying documents

@pubkey
Copy link
Owner

pubkey commented Jul 30, 2024

Primary key must always be a string.

@gizm0bill gizm0bill force-pushed the bug/boolean_indexes_key_compression_dexie branch from 6bfaa6f to eb71c30 Compare July 31, 2024 08:17
@gizm0bill
Copy link
Author

Ok I have modified it but still fails. You can also look in the browser's indexeddb storage, indexes for [_deleted+__a+passportId] and [_deleted+__b+__c+__a+passportId] are empty

@gizm0bill gizm0bill force-pushed the bug/boolean_indexes_key_compression_dexie branch from eb71c30 to 4e3cb88 Compare July 31, 2024 08:20
@pubkey
Copy link
Owner

pubkey commented Jul 31, 2024

You did not set maxLength for the primary key. Please read the docs and enable the dev-mode plugin in your setup.

@pubkey pubkey closed this Jul 31, 2024
@pubkey pubkey reopened this Jul 31, 2024
@gizm0bill gizm0bill force-pushed the bug/boolean_indexes_key_compression_dexie branch from 4e3cb88 to 9416099 Compare July 31, 2024 10:59
@gizm0bill gizm0bill force-pushed the bug/boolean_indexes_key_compression_dexie branch from 9416099 to 5e4a93e Compare July 31, 2024 11:05
@gizm0bill
Copy link
Author

I have updated the unit, please take a look now

@pubkey
Copy link
Owner

pubkey commented Aug 1, 2024

@gizm0bill Thank you. I can reproduce this now, I will check.

@pubkey
Copy link
Owner

pubkey commented Aug 1, 2024

Fixed here: #6280

@pubkey pubkey closed this Aug 1, 2024
@gizm0bill
Copy link
Author

Danke!

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.

2 participants