-
Notifications
You must be signed in to change notification settings - Fork 170
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
Reuse transaction when refreshing subscriptions after commit #8068
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build jonathan.reams_3585Details
💛 - Coveralls |
I've confirmed this fixed the issue we were seeing with Realm Core v14.13.4 via realm/realm-js#6961 |
src/realm/sync/subscriptions.cpp
Outdated
@@ -970,9 +964,9 @@ SubscriptionSet SubscriptionStore::get_by_version(int64_t version_id) | |||
throw KeyNotFound(util::format("Subscription set with version %1 not found", version_id)); | |||
} | |||
|
|||
SubscriptionSet SubscriptionStore::get_refreshed(ObjKey key, int64_t version, std::optional<DB::VersionID> db_version) | |||
SubscriptionSet SubscriptionStore::get_refreshed(ObjKey key, int64_t version, std::optional<TransactionRef> maybe_tr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you don't need std::optional here. TransactionRef
is already a pointer type that can be checked for null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its clearer with the optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just that we have a tradition for checking the pointer directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🇮🇹
What, How & Why?
Instead of throwing the read transaction away after committing subscription changes and then opening a new frozen transaction at the committed transaction's version - we should just re-use the read transaction.
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed