-
-
Notifications
You must be signed in to change notification settings - Fork 642
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
toArray returns array with null element #2022
Comments
It is possible to insert null values into indexedDB but they would never be returned when querying on an index like this code shows. I would say that it is impossible that this could happen unless there would be a bug in the indexedDB implementation that I never heard of. Are you sure the error comes from this part of the code? |
Yeah, similar code* is present in some other parts of the application and the stacktraces all point to either the destructuring of the null entry or accessing the
The fact that it crashes isn't really a big issue to me, but I would need to somehow remove the null entries from the table as I also got a Other example, that does not result in the error but simply never enters the while-loop's body:
Which makes sense, as that would equate to |
I think..... this should work to clear out the queue table. right?
|
Yes, but I'm still confused that a null entry could get there. Is the query performed in a liveQuery() If so, this could indicate a bug in Dexie's cache (which is only active in liveQuery contexts) - and if that would be the case, removing the null entries wouldn't lead anywhere. A better workaround if so, would be to filter them out from the result. In the case of indexeddb bug, the code you show should delete the entry. |
The place where we show a count of entries in the queue relies on dexie-observable with a simple count, so it doesn't crash on this as the entries themselves aren't used. The part I just showed you is executed onClick. I'll report back once I know more :-) |
Dexie 3.2.7
Given the following code:
I get the following error (only for one user, for everyone else it works perfectly fine)
(The build process moves the destructuring assignment to the function body, replacing the function params with an object called
e
)So that means the array
entries
is[null]
, But I have trouble reproducing this as dexie won't let me insert null items into the queue table. How can this happen, and how do I get rid of thesenull
items?The text was updated successfully, but these errors were encountered: