Skip to content

Commit

Permalink
Use correct tests when determining whether to send a QUERY message (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreams authored Jan 14, 2022
1 parent e0d8336 commit 733f127
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* None.
* Sending a QUERY message may fail with `Assertion failed: !m_unbind_message_sent` ([#5149](https://github.com/realm/realm-core/pull/5149), since v11.8.0)

### Breaking changes
* None.
Expand Down
5 changes: 4 additions & 1 deletion src/realm/sync/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,10 @@ void SessionImpl::on_resumed()

void SessionImpl::on_new_flx_subscription_set(int64_t new_version)
{
if (m_conn.get_state() == ConnectionState::connected) {
// If m_state == State::Active then we know that we haven't sent an UNBIND message and all we need to
// check is that we have completed the IDENT message handshake and have not yet received an ERROR
// message to call ensure_enlisted_to_send().
if (m_state == State::Active && m_ident_message_sent && !m_error_message_received) {
logger.trace("Requesting QUERY change message for new subscription set version %1", new_version);
ensure_enlisted_to_send();
}
Expand Down

0 comments on commit 733f127

Please sign in to comment.