Skip to content

Commit

Permalink
Change interface of realm_sync_immediately_run_file_actions to report…
Browse files Browse the repository at this point in the history
… result
  • Loading branch information
nielsenko committed Dec 14, 2022
1 parent a396142 commit 1944f44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
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`. (()[])

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Expand Down
3 changes: 2 additions & 1 deletion src/realm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3940,9 +3940,10 @@ 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.
* @param did_run ptr to bool, which will be set to true if operation was successful
* @return true if operation was succesful
*/
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
5 changes: 3 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,11 @@ 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

0 comments on commit 1944f44

Please sign in to comment.