Fix test pref disappear on android if open app in offline mode - #14897
Conversation
|
@luacmartins @0xmiroslav One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@jatinsonijs I think Tests step needs adjusted a bit. |
|
Hi @0xmiroslav we have to create .env file to use to use .env.staging configs |
|
I have not found any direct way to test it, I think there is different process to generate staging apk, but we can test it by creating .env file and add a variable ENVIRONMENT=staging so that we can match the condition. we can only test it on android native. So I think there is not any correct steps to actually test it on all platform. Like iOS need TestFlight to test it. I have test iOS by change in code itself as we have to must add video we cannot skip it. |
|
Tests step is for engineer review. So to be easy, we can just update step like this:
|
|
Yes it will work also, initially I have test by this. |
|
can I include sometime like this in test steps ? |
I now have step. So up to @luacmartins |
|
@jatinsonijs yes, you can include that in test steps only. QA steps shouldn't have any changes in code, since our QA team will be testing the staging APK. |
| }) | ||
| .catch(() => { | ||
| resolve(false); | ||
| // In case version fetch failed like in offline mode use last saved value |
There was a problem hiding this comment.
| // In case version fetch failed like in offline mode use last saved value | |
| // Use lastBetaValue in case we fail to fetch the new one, e.g. when we are offline |
| import ONYXKEYS from '../../../ONYXKEYS'; | ||
| import * as AppUpdate from '../../actions/AppUpdate'; | ||
|
|
||
| let lastBetaValue = false; |
There was a problem hiding this comment.
This name suggests that we are storing a version string. I think we should change it to better describe that it's storing a bool:
| let lastBetaValue = false; | |
| let isBeta = false; |
There was a problem hiding this comment.
Good suggestion! Since this is boolean flag, it's standard to add is prefix
There was a problem hiding this comment.
@luacmartins actually its conflict with inner const isBeta = semver.gt(pkg.version, productionVersion); isBeta variable name that's why I have used this name.
There was a problem hiding this comment.
Something like isLastSavedBeta?
There was a problem hiding this comment.
Yes @0xmiroslav let me change by isLastSavedBeta
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.mp4Desktopdesktop.movAndroidandroid.mp4 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.2.68-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.2.68-0 🚀
|

Details
We are checking android app is in beta or not by comparing version from GitHub url. When we are offline we cannot fetch this information.
To solve this problem save last checked isBeta value in local storage and use them in fetch failed case like when offline.
Fixed Issues
$ #14047
PROPOSAL: #14047 (comment)
Tests
NOTE: This issue is only related to android native. There is not any impact on another platforms.
App/src/libs/Environment/getEnvironment/index.native.js
Chatslabel.Offline tests
Chatslabel.QA Steps
NOTE: We cannot test it on web and mobile web as Its required to reload the app but in offline mode refresh page will not work.
Chatslabel.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
web.mp4
Mobile Web - Chrome
mweb-chrome.mp4
Mobile Web - Safari
mweb-safari.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4