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

Fix: presence map key and get with query (clientId and connectionId) #647

Merged
merged 4 commits into from
Nov 16, 2017

Conversation

ricardopereira
Copy link
Contributor

@ricardopereira ricardopereira requested a review from tcard November 15, 2017 13:07
@@ -3590,6 +3590,174 @@ class RealtimeClientPresence: QuickSpec {
}
}

// RTP11c2
fit("should return members filtered by clientId") {
Copy link
Contributor

Choose a reason for hiding this comment

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

fit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done d157cb2. Thanks.

let options = AblyTests.commonAppSetup()
let now = NSDate()

var clientMembers: ARTRealtime?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used for anything? It doesn't seem to, as then you use presenceData as mock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tcard Just to be sure it filters different connectionId's from 101 members.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I don't follow. Where are you checking that? I only see that you check against the presenceData dataset, not against the members you actually push.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

But 1. that's not even in this test, and 2. in that query you're also checking against the presenceData dataset by mocking the SYNC process, so clientMembers are never retrieved unless I'm missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. I was looking at the other test. I'll change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done d157cb2.

}
expect(members).to(haveCount(2))
expect(members).to(allPass({ (member: ARTPresenceMessage?) in member!.action != .absent }))
expect(members.filter{ $0.clientId == "a" }).to(beEmpty())
Copy link
Contributor

Choose a reason for hiding this comment

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

How will this be empty, given that, in presenceData, messages with client ID a also have connection ID one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tcard client ID a has a leave action.

Sorry, I copy&pasted the mock data from another test and maybe that's confusing you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see the timestamps. It may be a bit clearer if the order in the array was the chronological order, but never mind.

@ricardopereira
Copy link
Contributor Author

Both are passing https://travis-ci.org/ably/ably-ios/builds/302897096#L3032-L3033 but maybe I should look at the other tests. I don't know if it was me that broke the tests or they already were broken.

@ricardopereira
Copy link
Contributor Author

WDYT?

@tcard
Copy link
Contributor

tcard commented Nov 16, 2017

@ricardopereira I think this PR can be merged and that should be addressed separately (#652).

@ricardopereira ricardopereira merged commit 3efd759 into master Nov 16, 2017
@ricardopereira ricardopereira deleted the fix-presence-map-key branch November 16, 2017 14:51
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.

2 participants