You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently updated Dexie from 3.2.6 to 4.0.8. Since then one of my queries throws the error Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key in certain cases.
The query looks like this:
After some investigation I found, that the error is thrown, if there are entries for "foreignKey1" where "foreignKey2" is "null".
In my case the foreignKey1 is never "null" so switching order of the fields in "where" solves the error and this code works:
Thanks. The behaviour should be fixed by switching to using cmp.ts instead of idb.cmp() at this location. By using cmp.ts (which is also much faster that indexedDB.cmp()), a null comparision returns NaN instead of throwing, which is what would be correct here.
I recently updated Dexie from 3.2.6 to 4.0.8. Since then one of my queries throws the error
Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key
in certain cases.The query looks like this:
After some investigation I found, that the error is thrown, if there are entries for "foreignKey1" where "foreignKey2" is "null".
In my case the foreignKey1 is never "null" so switching order of the fields in "where" solves the error and this code works:
As I did not define a compound index for the two fields it shows a warning but returns the correct results.
The text was updated successfully, but these errors were encountered: