Closed SogoGolf closed 5 years ago
Hi @SogoGolf, this was a bug recently introduced with the Stitch Sync API. This has been corrected and a fix will be published soon
I will let you know and close this issue when the fix is published.
Hi @SogoGolf, this bug should be fixed now, let us know if you have any further issues!
thanks @adamchel ! do i need to update the gradle version ? I'm not being prompted in Android Studio to bump the version of org.mongodb:stitch-android-sdk:4.1.4
so not really sure how I'm supposed to check the fix?
Looking at master
branch it says the latest commit (b6c235f) was 6 days ago
there should be no need, this was a fix we made on the Stitch backend API that the SDK communicates with
oh ok gotcha. i just tested by changing a doc on the server and the callback wasn't triggered on the Android client app. I'll give it another try now to make sure i didn't miss anything.
alrighty gave that a try, still not working. if i update a doc on the server, the callback in Android app is not firing.
however it looks like the original listed above - this one - no longer occurs.
2019-01-11 11:13:51.022 15480-16912/com.mongodb.stitch.sdk.examples.todo E/items: NamespaceChangeStreamListener::stream ns=todo.items exception on fetching next event: java.lang.IllegalStateException: expected updatedFields to be present
java.lang.IllegalStateException: expected updatedFields to be present
Did you test this fix in the same Todo example app to confirm server side data changes we're syncing back to the client ?
I also saw this in the log at app start (before entering any Todo's on the client, or updating some data on the server):
01-23 09:29:49.910 5465-5525/com.mongodb.stitch.sdk.examples.todo E/items: NamespaceChangeStreamRunner::run error happened while opening stream:
(com.mongodb.stitch.core.StitchRequestException: java.io.InterruptedIOException: thread interrupted): TRANSPORT_ERROR: the request transport encountered an error communicating with Stitch
at com.mongodb.stitch.core.internal.net.BaseStitchRequestClient.doRequestUrl(BaseStitchRequestClient.java:61)
at com.mongodb.stitch.core.internal.net.StitchAppRequestClientImpl.initAppMetadata(StitchAppRequestClientImpl.java:88)
at com.mongodb.stitch.core.internal.net.StitchAppRequestClientImpl.doStreamRequest(StitchAppRequestClientImpl.java:67)
at com.mongodb.stitch.core.auth.internal.CoreStitchAuth.openAuthenticatedStream(CoreStitchAuth.java:218)
at com.mongodb.stitch.core.services.internal.CoreStitchServiceClientImpl.streamFunction(CoreStitchServiceClientImpl.java:174)
at com.mongodb.stitch.core.services.mongodb.remote.sync.internal.NamespaceChangeStreamListener.openStream(NamespaceChangeStreamListener.java:200)
at com.mongodb.stitch.core.services.mongodb.remote.sync.internal.NamespaceChangeStreamRunner.run(NamespaceChangeStreamRunner.java:57)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.io.InterruptedIOException: thread interrupted
at okio.Timeout.throwIfReached(Timeout.java:145)
at okio.Okio$1.write(Okio.java:76)
at okio.AsyncTimeout$1.write(AsyncTimeout.java:180)
at okio.RealBufferedSink.flush(RealBufferedSink.java:224)
at okhttp3.internal.http1.Http1Codec.finishRequest(Http1Codec.java:166)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at com.mongodb.stitch.core.internal.net.OkHttpTransport.roundTrip(OkHttpTransport.java:104)
at com.mongodb.stitch.core.internal.net.BaseStitchRequestClient.doRequestUrl(BaseStitchRequestClient.java:59)
Might be worth re-opening the ticket till this is resolved.
Hmm, I have not seen that error before. We currently run a set of integration tests before releasing that is separate from the ToDo example app, so it's possible this issue was not caught. I will reopen this issue and investigate it tomorrow.
thanks @adamchel . might be worth checking that the integration tests check the sync api from both directions (offline scenario i guess) ie. data change/sync from client -> server, data change/sync from server -> client
hey @adamchel i noticed in the documentation today that any "external" changes made to Atlas collections that are being sync'd, must have their __stitch_sync_version
's v
property manually incremented by whatever external app is making a change to that document.
so i made a change to one of those sync'd Todo items (using Studio 3T) AND i incremented that v
property. The "MyUpdateListener" callback in the Android app then immediately triggered and carried with it the data change.
so that server -> client flow is working as intended which is great.
lastly, that error log above seems to be related to auth. i didn't enable facebook and google auth so am wondering if the error is related to that ?
Hi @SogoGolf, I'm glad to hear you resolved the issue. We'll look into more prominently documenting that caveat.
As for the error log, it seems to indicate a TRANSPORT_ERROR
, which is usually due to an intermittent network issue. Are you consistently seeing that error or did you only see it once? If you're consistently seeing it, please let me know the steps to reproduce it so I can investigate it further.
@SogoGolf I'm closing this, as it was an issue with not setting the version. That being said, I have a ticket to look at ways we can call out that "gotcha" more prominently in the docs.
@SogoGolf if you continue to see that other error, please open an issue at https://github.com/mongodb/stitch-android-sdk
hi, nice work with Stitch and Stitch sync beta.
when running the Todo sync sample app for Android, i noticed that if i made a change ON THE SERVER via the Stitch web UI, to a document in the collection (ie todo.items) --> that change would NOT sync back to the running Android app.
looking in the logs I saw this:
Is this a bug with the Stitch sync API ?
Also, this error listener/handler in the sample Android app did not trigger. I would have thought that it should have ?