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.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

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.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e49afc1a-59a7-48ef-b8f5-30b92e58608b
Commits

Reviewing files that changed from the base of the PR and between 6fc28af and 92b327b.

Files selected for processing: 2
  • internal/ably/realtime_presence.go
  • internal/ably/realtime_presence_internal_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

The option always set waitForSync to true, so PresenceGetWithWaitForSync(false)
still blocked until the presence sync completed (RTP11c1).
@RaphaelFakhri
RaphaelFakhri force-pushed the fix/presence-get-wait-for-sync branch from 9bd92f0 to 92b327b Compare November 3, 2026 10:22
@RaphaelFakhri

Copy link
Copy Markdown
Author

Rebased onto main after the 2.0.0 restructure. TestPresenceGetOptions_WaitForSync_RTP11c1 passes, and fails on main for the false case.

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