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

Change interface of realm_sync_immediately_run_file_actions to report… #6117

Merged
merged 3 commits into from
Dec 14, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Breaking changes
* Core no longer provides any vcpkg infrastructure (the ports submodule and overlay triplets), because it handles dependant libraries internally now.
* Allow Realm instances to have a complete view of their schema, if mode is additive. ([PR #5784](https://github.com/realm/realm-core/pull/5784)).
* `realm_sync_immediately_run_file_actions` (c-api) now takes a third argument `bool* did_run` that will be set to the result of `SyncManager::immediately_run_file_actions`. ((#6117)[https://github.com/realm/realm-core/pull/6117])

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Expand Down
6 changes: 4 additions & 2 deletions src/realm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3940,9 +3940,11 @@ RLM_API void realm_sync_session_resume(realm_sync_session_t*) RLM_API_NOEXCEPT;
* needed
* @param realm_app ptr to realm app.
* @param sync_path path where the sync files are.
* @return true if operation was succesful
* @param did_run ptr to bool, which will be set to true if operation was successful
* @return true if operation was successful
*/
RLM_API bool realm_sync_immediately_run_file_actions(realm_app_t* realm_app, const char* sync_path) RLM_API_NOEXCEPT;
RLM_API bool realm_sync_immediately_run_file_actions(realm_app_t* realm_app, const char* sync_path,
bool* did_run) RLM_API_NOEXCEPT;

/**
* Register a callback that will be invoked every time the session's connection state changes.
Expand Down
6 changes: 4 additions & 2 deletions src/realm/object-store/c_api/sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,10 +913,12 @@ RLM_API void realm_sync_session_resume(realm_sync_session_t* session) noexcept
(*session)->revive_if_needed();
}

RLM_API bool realm_sync_immediately_run_file_actions(realm_app* app, const char* sync_path) noexcept
RLM_API bool realm_sync_immediately_run_file_actions(realm_app_t* realm_app, const char* sync_path,
bool* did_run) noexcept
{
return wrap_err([&]() {
return (*app)->sync_manager()->immediately_run_file_actions(sync_path);
*did_run = (*realm_app)->sync_manager()->immediately_run_file_actions(sync_path);
return true;
});
}

Expand Down
3 changes: 2 additions & 1 deletion test/object-store/c_api/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4643,7 +4643,8 @@ TEST_CASE("C API - client reset", "[c_api][client-reset]") {
void reset_realm(const char* path)
{
realm_app_t realm_app{m_app};
realm_sync_immediately_run_file_actions(&realm_app, path);
bool did_run;
realm_sync_immediately_run_file_actions(&realm_app, path, &did_run);
}
static ResetRealmFiles& instance()
{
Expand Down