-
Notifications
You must be signed in to change notification settings - Fork 283
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 shows green icon when tracking is inactive #722
Conversation
Hi @tstirrat GetStoreData is an async method but it gets called as a sync method. There are two GetStoreData calls inside the checkIfUserAtRisk method. One is setting this.setState({ currentState: StateEnum.NO_CONTACT }) and another setting currentState: StateEnum.SETTING_OFF, . We can't be sure which will set the state first due to the async method. So I have checked inside one to another. |
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.
Ohhh, good catch regarding the race condition!
Though, even with this change, it's still there. Can you eliminate 🐛 the race condition completely?
Move all of the checking logic inside:
GetStoreData(PARTICIPATE).then(isParticipating => {
// move all other checks inside here
});
Sure. I will change it |
Point of style ... can you please rename this PR to something meaningful. It's hard to keep track of which PR is which when we just reference another issue. |
Yes !!! ^^^ We don't know what issue 123 is so don't make us do more work. We're already very busy |
I didn't get the above points. I have already mentioned the issue 646. Do I need to do any changes from my side? |
Please don't take this the wrong way ... love the work you've done. But it is important that we have people follow the style of how PR's should be done. As Tim said, it's really about helping with the understandability of the PR. If the title of the PR says what it really is, then the reviewer doesn't have to spend time digging out the issue and figuring out what is going on, how to verify, etc. Remember that code reviewers are tracking multiple issues, so issue numbers get hard to remember. It's also much more helpful in the event we need to go back through PR's to figure out what went in, when, and possibly if we need to revert. Here's an example of what you might have done on this pr (Looking at the discussion, you already ended up writing much of this in your first comment): For the PR title For the PR Description |
Oops, I made my comment without good explanation. Ken explained it way better, thanks :) I think we can/should write a wiki or docs on this to make it clearer 😸 |
Noted:) |
Tested on 2 x android emus and 1x iOS emu. Looks good. |
* develop: Set up location after skiping the steps (#721) App shows green icon when tracking is inactive (#722) Fix postinstall script on Windows (#720) Fix isVersionGreater and add tests (#726) update the upgrade version to 1.0.0, to match what is in the master branch and avoid mistaken forced upgrades. (#723) 1.0.1 (#715) Put GPS filter behind dev flag (#714) Fix headline1 text cutoff (#712) Put auto sub behind dev flags (#711) remove default news url from News.js constructor (#704) Fix i18n placeholder for authorities (#709)
* develop: (22 commits) Translation refresh (#708) updated issue template (#729) Set up location after skiping the steps (#721) App shows green icon when tracking is inactive (#722) Fix postinstall script on Windows (#720) Fix isVersionGreater and add tests (#726) update the upgrade version to 1.0.0, to match what is in the master branch and avoid mistaken forced upgrades. (#723) 1.0.1 (#715) Put GPS filter behind dev flag (#714) Fix headline1 text cutoff (#712) Put auto sub behind dev flags (#711) remove default news url from News.js constructor (#704) Fix i18n placeholder for authorities (#709) Remove react-native-maps (#695) Fix e2e authority auto sub tests (#706) Fallback to English translations in e2e tests (#697) Add ja and fil languages (#700) Add a script to pull translations from lokalise (#641) Really really push to lokalise (#699) Run lokalize push on merge into develop (#698) ...
* develop: Translation refresh (#708) updated issue template (#729) Set up location after skiping the steps (#721) App shows green icon when tracking is inactive (#722) Fix postinstall script on Windows (#720) Fix isVersionGreater and add tests (#726) update the upgrade version to 1.0.0, to match what is in the master branch and avoid mistaken forced upgrades. (#723) 1.0.1 (#715) Put GPS filter behind dev flag (#714) Fix headline1 text cutoff (#712) Put auto sub behind dev flags (#711)
* develop: Recommend PR best practices in PR template (#750) Add eslint react-hooks checks (#751) iOS: Added local notification in terminate function. (#521) Update dev README (#705) Better error logging in Google import (#703) Remove rebasing from suggestions in CONTRIBUTING.md (#724) Translation refresh (#708) updated issue template (#729) Set up location after skiping the steps (#721) App shows green icon when tracking is inactive (#722) Fix postinstall script on Windows (#720) Fix isVersionGreater and add tests (#726) update the upgrade version to 1.0.0, to match what is in the master branch and avoid mistaken forced upgrades. (#723) 1.0.1 (#715) Put GPS filter behind dev flag (#714) Fix headline1 text cutoff (#712) Put auto sub behind dev flags (#711) remove default news url from News.js constructor (#704) Fix i18n placeholder for authorities (#709)
* develop: (60 commits) Recommend PR best practices in PR template (#750) Add eslint react-hooks checks (#751) iOS: Added local notification in terminate function. (#521) Update dev README (#705) Better error logging in Google import (#703) Remove rebasing from suggestions in CONTRIBUTING.md (#724) Translation refresh (#708) updated issue template (#729) Set up location after skiping the steps (#721) App shows green icon when tracking is inactive (#722) Fix postinstall script on Windows (#720) Fix isVersionGreater and add tests (#726) update the upgrade version to 1.0.0, to match what is in the master branch and avoid mistaken forced upgrades. (#723) 1.0.1 (#715) Put GPS filter behind dev flag (#714) Fix headline1 text cutoff (#712) Put auto sub behind dev flags (#711) remove default news url from News.js constructor (#704) Fix i18n placeholder for authorities (#709) Remove react-native-maps (#695) ...
Linked issues:
Fixes #646
Screenshots:
How to test