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

Clear pending reactive queries after firing #178

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cpp/DBHostObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ void DBHostObject::flush_pending_reactive_queries(std::shared_ptr<jsi::Value> re
}
}

pending_reactive_queries.clear();

invoker->invokeAsync(
[this, resolve]() { resolve->asObject(rt).asFunction(rt).call(rt, {}); });
}
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PODS:
- hermes-engine (0.76.0):
- hermes-engine/Pre-built (= 0.76.0)
- hermes-engine/Pre-built (0.76.0)
- op-sqlite (9.2.4):
- op-sqlite (9.2.6):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1785,7 +1785,7 @@ SPEC CHECKSUMS:
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
hermes-engine: 9de51d2f67336348a6cd5b686330e436d1dbd522
op-sqlite: 298654d710ae6b0e52a23136de40dad579ca3203
op-sqlite: 92fef1bcdad6299e2c87d11c0dc68404ad809d00
RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648
RCTDeprecation: 4c2c4a088b6f0ccfcbd53c9d5614b0238ad57909
RCTRequired: 2d8a683a7848bc0baf5883f0792c1ac43f6267b5
Expand Down
5 changes: 3 additions & 2 deletions example/src/tests/reactive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ export function reactiveTests() {

unsubscribe();

db.execute('UPDATE User SET name = ? WHERE id = ?;', ['Foo', 1]);

await db.transaction(async tx => {
await tx.execute('UPDATE User SET name = ? WHERE id = ?;', ['Foo', 1]);
});
await sleep(20);
expect(emittedCount).to.eq(1);
});
Expand Down
Loading