fix: Correctly null cache in transactions for indexeddb
This is similar to the bug in the sqflite but now for the indexeddb.
This commit is contained in:
parent
925bc6096f
commit
534a2a4ff1
|
|
@ -158,7 +158,7 @@ class Box<V> {
|
||||||
Future<void> delete(String key, [Transaction? txn]) async {
|
Future<void> delete(String key, [Transaction? txn]) async {
|
||||||
if (boxCollection._txnCache != null) {
|
if (boxCollection._txnCache != null) {
|
||||||
boxCollection._txnCache!.add((txn) => delete(key, txn));
|
boxCollection._txnCache!.add((txn) => delete(key, txn));
|
||||||
_cache.remove(key);
|
_cache[key] = null;
|
||||||
_cachedKeys?.remove(key);
|
_cachedKeys?.remove(key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -177,7 +177,9 @@ class Box<V> {
|
||||||
Future<void> deleteAll(List<String> keys, [Transaction? txn]) async {
|
Future<void> deleteAll(List<String> keys, [Transaction? txn]) async {
|
||||||
if (boxCollection._txnCache != null) {
|
if (boxCollection._txnCache != null) {
|
||||||
boxCollection._txnCache!.add((txn) => deleteAll(keys, txn));
|
boxCollection._txnCache!.add((txn) => deleteAll(keys, txn));
|
||||||
keys.forEach(_cache.remove);
|
for (final key in keys) {
|
||||||
|
_cache[key] = null;
|
||||||
|
}
|
||||||
_cachedKeys?.removeAll(keys);
|
_cachedKeys?.removeAll(keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue