-
Notifications
You must be signed in to change notification settings - Fork 298
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
App needs trigger(going back to home screen and realunch) to sync/pull docs #1083
Comments
@ashvindersingh I couldn't reproduce the issue. ChangeTracker sometimes waits for several seconds (wait time increases exponentially) before retrying. Could you add the following loggings If possible, please delete the existing
|
@pasin I will try without enableLogging |
Please enable the following:
|
@ashvindersingh do you have any updates on this? |
Please try with |
I didn't know that ToDoLite disables WebSockets by default. So that means our testathon last week wasn't testing WebSocket-based changes feeds :( |
Actually three of us had this enabled: @michaelkwok , @suravarjjala and myself. We had our todoLite with settings:
|
I was able to reproduce. WebSocket Change Tracker stopped without error right after bringing the SyncGateway offline.
|
This is weird as I couldn't reproduce the same behavior with the unit test.
|
OK, the same behavior can be reproduced only when the sync-gateway URL is non-SSL. From SyncGateway log when URL is http://xxx
|
Look like the bug is down at the PocketSocket library that when the URL is non-ssl, the websocket is closed without an error when bringing the SyncGateway offline. |
I debugged into the PocketSocket library and found that the WebSocket closed with '1000' status code (1000 = Normal closure). However when the remote URL is https, there is an error event stream happens right after while the closing socket is waiting for processing on a dispatch queue. At this point, I think it might be that SyncGateway may need to send a status code that can indicate WebSocket error (https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent) so that the WebSocket library can handle that properly. |
If the server closes the WebSocket connection, even cleanly with no error status, the change tracker should treat it as a recoverable error and retry. Fixes #1083
Even if the server closes the connection cleanly/normally, the change-tracker should still treat it as a (recoverable) error and retry. A WebSocket changes feed isn't supposed to close. |
I was seeing this issue only my test environment, not on development. I have enabled the log and posted here. (Both the environments using http not https) Seems like the CBLWebSocketChangeTracker is receiving the message but the CBLReplication is still in idle state and not pulling the doc until going back to home screen and realunch the app. 2017-12-20 16:41:02.522881+0530 MyApp[57504:6969061] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/aj/Library/Developer/CoreSimulator/Devices/B5226716-810A-4A58-A82A-2E0438100BA8/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles |
Another weird thing just now observed is on dev environment it is using CBLSocketChangeTracker and on test it is using CBLWebSocketChangeTracker. Is there any configuration that we can to use only CBLSocketChangeTracker since it is working perfectly fine ? |
Steps to reproduce:
Observe:
Device under test App doesn't pull docs automatically. Only after home button is pressed and App is again launched it pulls all docs.
The text was updated successfully, but these errors were encountered: