-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
On iOS Zulip will log out of realm/organization after force closing app and re opening. #3588
Comments
I am experiencing the same issues. I am on a iPhone 6s on iOS 12.4. I was just running Zulip on an android phone and it stays logged in perfectly fine. |
Thanks @dalanmiller and @ferman for these reports! One followup question for both of you:
We've also heard about this in a chat thread today, and we heard a report of it Friday in a support thread. I reproduce this myself when I make a fresh install of v26.1.124, the latest, on an iPhone 7 with iOS 12.3. The report on Friday was on v26.0.123, so it also affects that version. For me, the app was working just fine (staying logged in) before that fresh install. If it does only affect fresh installs (or, newly logged-into accounts on existing installs), then that's a clue because it suggests we're reading the stored data fine, and the bug specifically affects writing changes to it. This is a pretty showstopper symptom, so we'll certainly be making a priority of getting to the bottom of it. |
Confirm that we're observing iOS app version v26.1.124.
We're also running the most recent version of the Zulip docker container
available.
|
Update from some attempts to debug:
Things I did learn from when it was still reproducing in debug builds:
|
From a different angle:
So the bug was very likely introduced between 25.6.120 and 26.0.123. I'm looking at the code that changed in that interval.
|
26.1.124 then went out this morning, about 7 hours after this issue was filed. @dalanmiller <https://github.com/dalanmiller> you don't happen to have signed up to use the beta version from TestFlight, do you? If not, then your original report makes a second case of seeing the issue on 26.0.123.
I can confirm TestFlight is not installed on this device.
|
Notes from first efforts on that: I've tried three configurations:
"Remote JS debugging" means the Chrome DevTools, in my desktop Chrome browser, gets attached; and IIUC the JS all actually runs inside Chrome instead of in the JS implementation (JSC) that RN builds into the app. So far the pattern is that the issue reproduces 100% of the time in the first case (no "remote JS debugging"), and fails to repro -- i.e. the app works normally -- 100% of the time in the second and third. I was pretty sure I'd seen the issue repro yesterday in the simulated iPhone X with the devtools attached, and even with some ad-hoc logging code added. But while I tried taking out the logging code and was then concerned to see the issue continue to not reproduce, I don't think I tried going back to not even attaching the debugger. If I can't reproduce with the debugger attached that will certainly add an obstacle in debugging it; I'll have to find another way to get info out. OTOH it may also be a clue. |
Completing a small matrix, I just tried:
This isn't a super helpful setup in itself, because there isn't an immediate way to get those logs. But the issue indeed reproduced, fitting the pattern that it's all about whether the devtools are attached. |
My install that I reported is on a fresh install of iOS and of the app. I am on v26.0.123. |
New information from some debugging just now:
So the issue was introduced by the upgrade to RN v0.59. A key ingredient here was what I learned yesterday, that so long as I don't enable remote JS debugging, the issue reproduces 100% of the time.
In particular this finding appears to rule out those changes of ours as the cause. They happened before the RN upgrade, and before 25.8.122, at which point the issue is absent. As for what changes within RN might have caused this: in addition to the unlikely-looking small change in the AsyncStorage implementation that I discussed above, one thing that occurs to me is that RN upstream made significant changes to their JS runtime environment. It's possible that a bug in that -- or a bug in our (or a dependency's) JS code, that the new environment triggers and the old one didn't -- might somehow cause this failure. That would fit particularly nicely with the puzzle that the issue is suppressed by remote JS debugging -- because that debugging involves running the JS in an entirely different environment, namely my desktop Chrome browser. A likely next thing I'll pursue is to bisect the changes in RN itself, in hopes of pinpointing the RN commit that introduces the issue. Possibly tricky to do, because other dependencies interact with the RN version. As a variation, I may attempt simply reverting some plausibly-relevant RN changes, or alternatively backporting them directly onto v0.57.8, to see if they affect the issue. |
Next finding: the issue
In both cases I'm starting from our dfbdd97, the RN upgrade; I've edited our package.json to refer to a version like (There's a wrinkle where our So, something in that range of 14 commits introduced the issue! Or the trigger for some issue in another layer. Those 14 commits are exactly the changes I mentioned here:
so that guess turned out to be a good one. A bit more about these changes:
and
Working on bisecting further. That's harder than it ought to be, because unfortunately these changes seem to have been made rather messily 😞 -- several of the commits cause RN itself to fail to build at all, failures that are fixed some time later in other commits. |
Further notes, then I'll pick this up tomorrow. Here's those 14 commits, along with my results on them so far:
Here
In particular the first 4 commits of the series are in the clear. That leaves this diff as where the issue (or, again, the change that triggers an issue elsewhere) may lie:
|
Because it's not clear how quickly we'll have a diagnosis or a forward-fix here, I'm now preparing a release 26.2.125, for iOS only, which will roll back to 25.8.122 -- it'll be identical except for the version number. That's the last release we sent to beta before 26.0.123; the only change between them was the RN upgrade and some related commits, and in particular I determined above that this issue doesn't appear there. I'll continue working to debug this to find a more targeted fix. We want to be on the newer RN version for a number of reasons, not least of them that RN v0.57 cannot make an app that meets Google Play's requirements (as announced in 2017 and in effect from this month; see #3323 ). But once the stopgap release 26.2.125 works its way through Apple's process, the issue should be resolved for everyone who's been seeing it. |
Done, and submitted to Apple. If all goes well within their process, then most likely this stopgap version will be available in the App Store by Monday. |
That stopgap fix release, 26.2.125, went out to the App Store on Saturday morning. Meanwhile, I've located the cause of the bug! Fix incoming, with more explanation; then I'll make a new release, so that iOS users can again have all the unrelated improvements we've made since the RN upgrade. |
For iOS the latest prod release was 26.2.125, not 26.1.124. So the login issue #3588 is already fixed, and there's no need to repeat the note on it.
This adds a new "scheme", which Apple's docs (in an old version -- somehow with Apple the highest-quality docs are always being abandoned for hipper designs with less-informative text) define like so: An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. You can have as many schemes as you want, but only one can be active at a time. [...] When you select an active scheme, you also select a run destination (that is, the architecture of the hardware for which the products are built). https://developer.apple.com/library/archive/featuredarticles/XcodeConcepts/Concept-Schemes.html The scheme is the dropdown by the top left of the main Xcode window, where we usually select "ZulipMobile". (I think the "run destination" is the dropdown just to its right, where we select a specific device or emulator to run on, or else "Generic iOS Device" when building an artifact to upload to the App Store.) The new "ZulipMobile release-mode" is just like "ZulipMobile", except that Cmd-r ("Run") will do a release build and run that on the target device, rather than a debug build. The "schemes" like the existing one and this new one live at a layer of indirection above the "configurations", of which we have two, named "Debug" and "Release". They contain a very small amount of configuration of their own, and mainly just a list of by-name references to configurations. The configurations themselves contain quite a bit more detail. Some helpful discussion: http://rhult.github.io/articles/testing-release-builds/ We're in "the simple case" in that post's terms: both our debug and release configurations already use development certs for signing. (For an actual release, I guess the artifact gets re-signed at upload time?) I originally did this in August, while debugging zulip#3588; didn't commit it, in part because I didn't feel I understood what it was doing. This version is slightly cleaned up and I've added this commit message, but it has the same substance as the config I left uncommitted then. Also I've read more and experimented more, and I think I grasp at least some of what this means now. :)
This adds a new "scheme", which Apple's docs (in an old version -- somehow with Apple the highest-quality docs are always being abandoned for hipper designs with less-informative text) define like so: An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. You can have as many schemes as you want, but only one can be active at a time. [...] When you select an active scheme, you also select a run destination (that is, the architecture of the hardware for which the products are built). https://developer.apple.com/library/archive/featuredarticles/XcodeConcepts/Concept-Schemes.html The scheme is the dropdown by the top left of the main Xcode window, where we usually select "ZulipMobile". (I think the "run destination" is the dropdown just to its right, where we select a specific device or emulator to run on, or else "Generic iOS Device" when building an artifact to upload to the App Store.) The new "ZulipMobile release-mode" is just like "ZulipMobile", except that Cmd-r ("Run") will do a release build and run that on the target device, rather than a debug build. The "schemes" like the existing one and this new one live at a layer of indirection above the "configurations", of which we have two, named "Debug" and "Release". They contain a very small amount of configuration of their own, and mainly just a list of by-name references to configurations. The configurations themselves contain quite a bit more detail. Some helpful discussion: https://rhult.github.io/articles/testing-release-builds/ We're in "the simple case" in that post's terms: both our debug and release configurations already use development certs for signing. (For an actual release, I guess the artifact gets re-signed at upload time?) I originally did this in August, while debugging zulip#3588; didn't commit it, in part because I didn't feel I understood what it was doing. This version is slightly cleaned up and I've added this commit message, but it has the same substance as the config I left uncommitted then. Also I've read more and experimented more, and I think I grasp at least some of what this means now. :)
This adds a new "scheme", which Apple's docs (in an old version -- somehow with Apple the highest-quality docs are always being abandoned for hipper designs with less-informative text) define like so: An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. You can have as many schemes as you want, but only one can be active at a time. [...] When you select an active scheme, you also select a run destination (that is, the architecture of the hardware for which the products are built). https://developer.apple.com/library/archive/featuredarticles/XcodeConcepts/Concept-Schemes.html The scheme is the dropdown by the top left of the main Xcode window, where we usually select "ZulipMobile". (I think the "run destination" is the dropdown just to its right, where we select a specific device or emulator to run on, or else "Generic iOS Device" when building an artifact to upload to the App Store.) The new "ZulipMobile release-mode" is just like "ZulipMobile", except that Cmd-r ("Run") will do a release build and run that on the target device, rather than a debug build. The "schemes" like the existing one and this new one live at a layer of indirection above the "configurations", of which we have two, named "Debug" and "Release". They contain a very small amount of configuration of their own, and mainly just a list of by-name references to configurations. The configurations themselves contain quite a bit more detail. Some helpful discussion: https://rhult.github.io/articles/testing-release-builds/ We're in "the simple case" in that post's terms: both our debug and release configurations already use development certs for signing. (For an actual release, I guess the artifact gets re-signed at upload time?) I originally did this in August, while debugging #3588; didn't commit it, in part because I didn't feel I understood what it was doing. This version is slightly cleaned up and I've added this commit message, but it has the same substance as the config I left uncommitted then. Also I've read more and experimented more, and I think I grasp at least some of what this means now. :)
Currently using a self-hosted instance with both Android and iOS. Android runs fine at the moment but on iOS the app will require logging into the organization every time the app is closed and started or opened after a long period of time.
How can I try to debug this issue or provide more information on what is going on?
The text was updated successfully, but these errors were encountered: