-
Notifications
You must be signed in to change notification settings - Fork 26
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: Realtime transport should fire events on a serial queue #578
Conversation
ea57a5f
to
2851625
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but can we add a test for this?
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0), _eventQueue, ^{ | ||
// Wait until the current event is done. | ||
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | ||
ARTEventListener *listener = [_internalEventEmitter once:^(ARTConnectionStateChange *change) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we always create the listener, ie. why the condition on line 409 has been moved below this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tcard Ah, that's wrong. Will fix it. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 380e6c7.
Test added a1a77d1. |
:/
I'll check what's wrong. |
e293dd1
to
ea548b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, although I can't really comment on the iOS specific details. It would be nice, as @tcard has said, to have one test that covers this background behaviour though.
@@ -0,0 +1,11 @@ | |||
#!/usr/bin/env bash | |||
set -eu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to commit this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it helps a lot when I only run one spec and I don't want to commit that to the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but that's for you and no else no? You leave here, but it's not that normal to add these utilities that you like to a shared repo
@mattheworiordan I already added a test: a1a77d1. |
Can I squash? |
@ricardopereira but a1a77d1 is in the Examples folder? What has that to do with tests? The name of that file btw is pretty horrific |
5749c46
to
3e3c6fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I have to defer to @tcard for final say here
@@ -0,0 +1,11 @@ | |||
#!/usr/bin/env bash | |||
set -eu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but that's for you and no else no? You leave here, but it's not that normal to add these utilities that you like to a shared repo
…ef observing the kCFRunLoopExit
- could get corrupted by other application code, i.e. the test suite blocks the current runloop. Using a `dispatch_semaphore` instead.
3e3c6fb
to
86ff7ad
Compare
Also adds {{API_KEY_SECRET}} as a variable in docs. Also seperately added to our JSBin.
It wasn't firing transport events when the Realtime object was created on a background queue.
UPDATE: Rest was with the same problem.