diff --git a/src/realm/sync/client.cpp b/src/realm/sync/client.cpp index 60bf74177dc..2e80e53528e 100644 --- a/src/realm/sync/client.cpp +++ b/src/realm/sync/client.cpp @@ -676,12 +676,11 @@ util::Optional& SessionImpl::get_client_reset_config() noexcept void SessionImpl::initiate_integrate_changesets(std::uint_fast64_t downloadable_bytes, DownloadBatchState batch_state, const ReceivedChangesets& changesets) { - bool simulate_integration_error = (m_wrapper.m_simulate_integration_error && !changesets.empty()); - if (simulate_integration_error) { - on_integration_failure(IntegrationException(ClientError::bad_changeset, "simulated failure"), batch_state); - } - try { + bool simulate_integration_error = (m_wrapper.m_simulate_integration_error && !changesets.empty()); + if (simulate_integration_error) { + throw IntegrationException(ClientError::bad_changeset, "simulated failure"); + } version_type client_version; if (REALM_LIKELY(!get_client().is_dry_run())) { VersionInfo version_info; @@ -694,11 +693,6 @@ void SessionImpl::initiate_integrate_changesets(std::uint_fast64_t downloadable_ // Fake it for "dry run" mode client_version = m_last_version_available + 1; } - - if (m_wrapper.m_on_download_integrated_hook) { - m_wrapper.m_on_download_integrated_hook(); - } - on_changesets_integrated(client_version, m_progress.download, batch_state); // Throws } catch (const IntegrationException& e) {