Skip to content
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] Fix persisted data loss on iOS #2249

Merged
merged 4 commits into from
Dec 16, 2019

Conversation

jeanregisser
Copy link
Contributor

Description

This fixes AsyncStorage data loss on iOS.

We had modules importing AsyncStorage from React Native Core and some others from React Native Community. The 2 implementations were essentially competing and causing the problem.

Since both implementations currently write to the same file on disk, the last one to write wins and erases the existing data written by the other.

See react-native-async-storage/async-storage#118 (comment)

Though I updated the offending import in Apollo, the fix here also makes sure this problem won't sneak back in if we add a dependency which still imports AsyncStorage from React Native Core. This is done by monkey patching React Native so it also returns the community implementation of AsyncStorage.

Pretty scary bug, I'm glad we didn't ship that 😅

Tested

Followed the steps to reproduced the issue as described in #2248, and observed the problem doesn't happen anymore.

Other changes

N/A

Related issues

Backwards compatibility

Yes

Copy link
Contributor

@cmcewen cmcewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch this looks like a rough one. Nice job tracking it down, and apologies for missing this in the original upgrade. Also nice job preventing future breaks

@jeanregisser jeanregisser added the automerge Have PR merge automatically when checks pass label Dec 16, 2019
@celo-ci-bot-user celo-ci-bot-user merged commit 03fb0ac into master Dec 16, 2019
@celo-ci-bot-user celo-ci-bot-user deleted the jeanregisser/fix-persisted-data-loss-on-ios branch December 16, 2019 09:48
aaronmgdr added a commit that referenced this pull request Dec 16, 2019
* master: (40 commits)
  Add utils as a dep (#2252)
  [Wallet] Create run_app.sh script to facilitate app development (#2186)
  [Wallet] Fix persisted data loss on iOS (#2249)
  adds Testing TSX /react on the web (#2229)
  Update running-a-validator.md (#2259)
  Add ts-ignore (#2254)
  Revert "Revert "Upgrade TS version (#2196)" (#2251)" (#2255)
  Force same bignumber version (#2256)
  Fix missing Text on website (#2237)
  Revert "Upgrade TS version (#2196)" (#2251)
  [Wallet] Refer to Celo Lite as "Data Saver" mode (#2232)
  Fix using requester instead of requestee at Outgoing notifications (#2240)
  Use correct phone placeholder depending on the country on joining Celo view (#2061)
  Update Attestation Bot Docker Image (#2231)
  Baklava phase 1.1 .env file (#2226)
  [Docs] Fix typo (#2225)
  Upgrade Dependencies and get react hooks working (#2203)
  Update attestation service docker images (#2202)
  Updates TME docker images (#2200)
  Remove walletkit from celotool transactions commands (#2206)
  ...

# Conflicts:
#	packages/web/package.json
aaronmgdr added a commit that referenced this pull request Dec 16, 2019
* master:
  Add utils as a dep (#2252)
  [Wallet] Create run_app.sh script to facilitate app development (#2186)
  [Wallet] Fix persisted data loss on iOS (#2249)
  adds Testing TSX /react on the web (#2229)
  Update running-a-validator.md (#2259)
  Add ts-ignore (#2254)
  Revert "Revert "Upgrade TS version (#2196)" (#2251)" (#2255)
  Force same bignumber version (#2256)
  Fix missing Text on website (#2237)
  Revert "Upgrade TS version (#2196)" (#2251)
  [Wallet] Refer to Celo Lite as "Data Saver" mode (#2232)
  Fix using requester instead of requestee at Outgoing notifications (#2240)
  Use correct phone placeholder depending on the country on joining Celo view (#2061)
  Update Attestation Bot Docker Image (#2231)
  Baklava phase 1.1 .env file (#2226)
  [Docs] Fix typo (#2225)
  Upgrade Dependencies and get react hooks working (#2203)
  Update attestation service docker images (#2202)
  Updates TME docker images (#2200)
  Remove walletkit from celotool transactions commands (#2206)
@jeanregisser jeanregisser self-assigned this Dec 18, 2019
@jeanregisser jeanregisser removed their assignment Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS wallet looses persisted app state
4 participants