Skip to content

ably: honor the wait argument of PresenceGetWithWaitForSync - #715

Open
RaphaelFakhri wants to merge 1 commit into
ably:mainfrom
RaphaelFakhri:fix/presence-get-wait-for-sync
Open

RaphaelFakhri wants to merge 1 commit into
ably:mainfrom
RaphaelFakhri:fix/presence-get-wait-for-sync

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Description

PresenceGetWithWaitForSync(wait bool) ignores its argument and always sets waitForSync to true. As a result, RealtimePresence.GetWithOptions(ctx, PresenceGetWithWaitForSync(false)) still blocks until the presence sync completes, which contradicts the documented behavior (RTP11c1).

This change assigns the wait value to the option.

Testing

Adds TestPresenceGetOptions_WaitForSync_RTP11c1, which checks the default, true, and false cases.

go test ./ably -run TestPresenceGetOptions_WaitForSync_RTP11c1 -count=1 -v

Without the fix, the false case fails and the other two cases pass. With the fix, all three cases pass.

The option always set waitForSync to true, so PresenceGetWithWaitForSync(false)
still blocked until the presence sync completed (RTP11c1).
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8f8d125c-3c0d-427e-a8a1-f1ea4d5a70b6

📥 Commits

Reviewing files that changed from the base of the PR and between 26cb171 and 9bd92f0.

📒 Files selected for processing (2)
  • ably/realtime_presence.go
  • ably/realtime_presence_internal_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant