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

Cancel subscription notifications #7073

Merged
merged 4 commits into from
Oct 31, 2023

Conversation

danieltabacaru
Copy link
Collaborator

@danieltabacaru danieltabacaru commented Oct 20, 2023

What, How & Why?

Completion callbacks are canceled when a fatal error is received from the server or the sync session becomes inactive. The subscription notifications would not fulfill in such cases causing a hang for the users. This PR addresses that by canceling the subscription notifications in such cases.

Fixes #5315.

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • [ ] C-API, if public C++ API changed.

@coveralls-official
Copy link

coveralls-official bot commented Oct 20, 2023

Pull Request Test Coverage Report for Build daniel.tabacaru_599

  • 85 of 87 (97.7%) changed or added relevant lines in 3 files are covered.
  • 87 unchanged lines in 13 files lost coverage.
  • Overall coverage decreased (-0.01%) to 91.572%

Changes Missing Coverage Covered Lines Changed/Added Lines %
test/object-store/sync/flx_sync.cpp 72 74 97.3%
Files with Coverage Reduction New Missed Lines %
src/realm/index_string.hpp 1 82.86%
src/realm/array_string.cpp 2 87.78%
src/realm/object-store/sync/sync_manager.cpp 2 86.58%
src/realm/query_expression.hpp 2 93.51%
src/realm/sync/instruction_applier.cpp 2 70.21%
src/realm/sync/noinst/server/server_history.cpp 2 67.69%
src/realm/util/file.cpp 2 81.25%
src/realm/sync/noinst/client_reset_operation.cpp 4 87.23%
src/realm/sync/noinst/server/server.cpp 4 76.25%
src/realm/util/assert.hpp 4 87.5%
Totals Coverage Status
Change from base Build 1792: -0.01%
Covered Lines: 230759
Relevant Lines: 251998

💛 - Coveralls

@danieltabacaru danieltabacaru changed the title Cancel pending waits for subscription notifications Cancel subscription notifications Oct 30, 2023
@danieltabacaru danieltabacaru marked this pull request as ready for review October 30, 2023 10:06
Copy link
Contributor

@michael-wb michael-wb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - maybe you could rename cancel_subscription_notifications to cancel_sub_notifications

@danieltabacaru danieltabacaru force-pushed the dt/fix_cancel_subscription_notification branch from 0181c0a to c51747b Compare October 31, 2023 20:27
@danieltabacaru danieltabacaru merged commit 6b189dd into master Oct 31, 2023
3 checks passed
@danieltabacaru danieltabacaru deleted the dt/fix_cancel_subscription_notification branch October 31, 2023 22:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Async operations should terminate with an error if a fatal session error occurs
2 participants