-
Notifications
You must be signed in to change notification settings - Fork 374
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
[Wallet] Prompt user to restart app when turning off Forno a second time #1708
Conversation
…fault-gradle-properties
gradle.properties
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.
Mostly looks good! Just a few small comments
packages/mobile/src/geth/saga.ts
Outdated
@@ -43,6 +43,7 @@ export function* waitForGethConnectivity() { | |||
|
|||
function* waitForGethInstance() { | |||
const zeroSyncMode = yield select(zeroSyncSelector) | |||
Logger.error(TAG, `zeroSync mode: ${zeroSyncMode}`) |
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.
why .error
here?
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.
Removed this log 👍
packages/mobile/src/web3/saga.ts
Outdated
@@ -372,7 +376,7 @@ export function* addAccountToWeb3Keystore(key: string, currentAccount: string, p | |||
) | |||
yield put(setAccountInWeb3Keystore(account)) | |||
} catch (e) { | |||
Logger.debug(TAG + '@addAccountToWeb3Keystore', 'Failed to import raw key') | |||
Logger.debug(TAG + '@addAccountToWeb3Keystore', `Failed to import raw key: ${e}`) |
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.
Should we use .error
here which can take e
as the 3rd param? It formats the exception messages nicely
packages/mobile/src/web3/saga.ts
Outdated
@@ -417,17 +421,29 @@ export function* ensureAccountInWeb3Keystore() { | |||
} | |||
|
|||
export function* switchToGethFromZeroSync() { | |||
Logger.debug(TAG + 'Switching to geth from zeroSync..') |
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.
, not +
packages/mobile/src/web3/saga.ts
Outdated
// there is an issue where it cannot find deployed contracts. | ||
// Restarting the app fixes this issue. | ||
yield call(navigate, Screens.WalletHome) | ||
Logger.debug(TAG + 'Showed message') |
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.
ditto
} | ||
|
||
onPressRestartModal = () => { | ||
this.props.toggleZeroSyncMode(false) |
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.
The naming has me a bit confused here. Any reason we dispatch this action here instead of restarting the app as the name says? I see below that the restart logic is in the saga instead, any reason we don't have it here?
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.
Good point. I updated the name to onPressToggleWithRestartModal
.
The restart logic is in the saga because we have to wait for geth to be turned on before restarting the app. Putting the restart logic here would require dispatching an action after the syncMode is done switching, and listening for that to know when to restart.
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.
👍
Codecov Report
@@ Coverage Diff @@
## master #1708 +/- ##
==========================================
- Coverage 74.43% 74.26% -0.17%
==========================================
Files 279 277 -2
Lines 7589 7617 +28
Branches 666 669 +3
==========================================
+ Hits 5649 5657 +8
- Misses 1825 1845 +20
Partials 115 115
Continue to review full report at Codecov.
|
Added snapshot tests for some unrelated components (GethAwareButton, FeeExchangeIcon) to increase code coverage |
* master: (81 commits) Make styling more consistent in validator quick start and add password prompt to account:unlock (#1731) New Version for contractkit (#1727) Remove end-to-end attestations test from circle (#1739) Added helper function to get the list of current validators (#1713) Fix flaky end-to-end transfer, protocol unit tests (#1734) Add AccountClaim to Metadata (#1663) [Wallet] Set default gradle properties (#1629) Update genesis block after adding parent signatures to block header (#1732) Removed end-to-end-geth-integration-sync-test job in workflow (#1730) Change the event we emit when selecting issuers (#1706) [Wallet] Prompt user to restart app when turning off Forno a second time (#1708) Check in spanish verification translations (#1726) [Wallet] Style fixes on iOS for verification and backup flows (#1718) [Wallet] Reset isRedeemingInvite on rehydrate (#1716) Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585) [Wallet] Add more local currencies (#1698) Switch to correct cluster when fauceting (#1687) [Wallet] Use the country of the phone number for determining the default local currency (#1684) [Wallet] Limit QR code scanner to 1 code per second (#1676) Update Dark backgrounds text color (#1677) ... # Conflicts: # packages/web/pages/_app.tsx # packages/web/src/dev/BuildPage.tsx # packages/web/src/dev/Cover.tsx # packages/web/src/dev/StackSection.tsx # yarn.lock
* master: (70 commits) Make styling more consistent in validator quick start and add password prompt to account:unlock (#1731) New Version for contractkit (#1727) Remove end-to-end attestations test from circle (#1739) Added helper function to get the list of current validators (#1713) Fix flaky end-to-end transfer, protocol unit tests (#1734) Add AccountClaim to Metadata (#1663) [Wallet] Set default gradle properties (#1629) Update genesis block after adding parent signatures to block header (#1732) Removed end-to-end-geth-integration-sync-test job in workflow (#1730) Change the event we emit when selecting issuers (#1706) [Wallet] Prompt user to restart app when turning off Forno a second time (#1708) Check in spanish verification translations (#1726) [Wallet] Style fixes on iOS for verification and backup flows (#1718) [Wallet] Reset isRedeemingInvite on rehydrate (#1716) Adjust e2e transfer and governance tests to match new fee distribution and eliminate ProposerFraction (#1585) [Wallet] Add more local currencies (#1698) Switch to correct cluster when fauceting (#1687) [Wallet] Use the country of the phone number for determining the default local currency (#1684) [Wallet] Limit QR code scanner to 1 code per second (#1676) Update Dark backgrounds text color (#1677) ...
Description
Currently, when users start geth twice in one app session (for example, Forno -> geth -> Forno -> geth, or geth -> Forno -> geth), the app fails to switch to geth the second time. Now, the app shows a modal prompting users to restart the app when they are starting geth for the second time in a session. When the app restarts geth works fine.
For some reason starting geth a second time in a single app session leads to a minimum gas price error, because it cannot find the Gold Token address as geth does not think it is deployed. Had done some geth debugging with help from Kevin but no clear solution, so adding this modal as a workaround for now.
Also fixes an issue where switching on Forno leads to the app thinking it's disconnected until the app is restarted. This was not caught before because the disconnect behavior was conflated with long block times.
Tested
On pilot:
Started in Forno, sent a transaction, turned it off, turned it on, turned it off, modal pops up- restarted app and sent transaction in geth mode.
Other changes
Remove some unused icons
Added snapshot tests for GethAwareButton, FeeExchangeIcon
Related issues
Backwards compatibility
Yes