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

chore: sync with valora #73

Merged
merged 16 commits into from
Feb 12, 2025
Merged

chore: sync with valora #73

merged 16 commits into from
Feb 12, 2025

Conversation

bakoushin
Copy link

Resolved conflicts

CONFLICT (rename/rename): mocks/react-native-fs.ts renamed to packages/@divvi/mobile/mocks/react-native-fs.ts in HEAD and to mocks/@divvi/react-native-fs.ts in upstream/main.
CONFLICT (rename/rename): mocks/react-native-keychain.ts renamed to packages/@divvi/mobile/mocks/react-native-keychain.ts in HEAD and to mocks/@divvi/react-native-keychain.ts in upstream/main.
CONFLICT (content): Merge conflict in package.json
CONFLICT (content): Merge conflict in packages/@divvi/mobile/src/analytics/AppAnalytics.test.ts
CONFLICT (content): Merge conflict in packages/@divvi/mobile/src/firebase/remoteConfigValuesDefaults.ts
CONFLICT (file location): src/navigator/DemoModeAuthBlock.test.tsx added in upstream/main inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to packages/@divvi/mobile/src/navigator/DemoModeAuthBlock.test.tsx.
CONFLICT (file location): src/navigator/DemoModeAuthBlock.tsx added in upstream/main inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to packages/@divvi/mobile/src/navigator/DemoModeAuthBlock.tsx.
CONFLICT (rename/delete): src/pincode/pin-blocklist-hibpv7-top-25k-with-keyboard-translations.json renamed to packages/@divvi/mobile/src/pincode/pin-blocklist-hibpv7-top-25k-with-keyboard-translations.json in HEAD, but deleted in upstream/main.
CONFLICT (modify/delete): packages/@divvi/mobile/src/pincode/pin-blocklist-hibpv7-top-25k-with-keyboard-translations.json deleted in upstream/main and modified in HEAD. Version HEAD of packages/@divvi/mobile/src/pincode/pin-blocklist-hibpv7-top-25k-with-keyboard-translations.json left in tree.
CONFLICT (content): Merge conflict in packages/@divvi/mobile/src/tokens/TabWallet.test.tsx
CONFLICT (content): Merge conflict in packages/@divvi/mobile/src/tokens/utils.ts
CONFLICT (content): Merge conflict in packages/@divvi/mobile/src/transactions/feed/TransactionFeed.test.tsx
CONFLICT (content): Merge conflict in packages/@divvi/mobile/src/transactions/feed/TransactionFeedV2.test.tsx
CONFLICT (modify/delete): src/firebase/remoteConfigValuesDefaults.e2e.ts deleted in HEAD and modified in upstream/main. Version upstream/main of src/firebase/remoteConfigValuesDefaults.e2e.ts left in tree.
CONFLICT (content): Merge conflict in yarn.lock

kathaypacific and others added 15 commits February 4, 2025 09:12
…nc#6469)

### Description

Unfortunately not all flows that access the private key go through the
same functions, so this PR adds a new blocking bottom sheet that is a
screen and navigates to it from:
1. `ensurePincode` - this is used from the flows that launch CAB / reset
pin / view recovery phrase
2. `sendPreparedTransaction` - this is used from all the transaction
flows, except for walletconnect
3. walletconnect saga, where we display the action request.

There is often UI that awaits the outcome of the transaction send flows
(spinners, navigation etc.) so I am returning the same result as if a
user dismissed the pincode screen during the flow.

### Test plan

Tested all flows to ensure the bottom sheet is correctly triggered, and
no extra errors are displayed.


https://github.com/user-attachments/assets/f376d1a7-a62c-43fa-b8a3-c598f81711d8



https://github.com/user-attachments/assets/eb817506-1cc1-4a8f-91c0-f9f3560e1455



https://github.com/user-attachments/assets/7bcdf0ee-00d9-465c-89c7-41f613669440



https://github.com/user-attachments/assets/5fbedfcd-7e2d-4b00-b61f-cec38788eb75



https://github.com/user-attachments/assets/55d26718-fa74-4406-a02f-257fdbc293c9


### Related issues

- Fixes RET-1304

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
…` fork (valora-inc#6470)

### Description

Migrate `react-native-keychain` to the `@interaxyz` fork in order to get
rid of the patch.

The patch changes are implemented in the fork:

oblador/react-native-keychain@master...mobilestack-xyz:react-native-keychain:intera-fork

Since the current version (8.2.0) is outdated, it was also upgraded to
the latest one (9.2.2), which required some refactoring.

### Test plan

* CI
* Manually tested on iOS device 
* Manually tested on an Android emulator

Manual test plan:
* Start existing wallet after upgrade
* Display recovery phrase
* Sign transaction
* Restore wallet using a recovery phrase
* Display recovery phrase

The library migrates the secrets storage in Android from
`SharedPreferences` to `DataStore` in [version
9.2.0](https://github.com/oblador/react-native-keychain/releases/tag/v9.2.0).
While the migration is expected to be seamless, perhaps we should do as
much manual testing on devices as we can to ensure there is no major
issue.
### Related issues

- Related to RET-1308

### Backwards compatibility

Y

### Network scalability

NA
…y configs (valora-inc#6473)

### Description

This PR removes some unused remote config configs, and replaces the
following with statsig:
- wallet connect v2 enabled -> feature gate (note that feature gates
always default to false, but we should default this value to true since
then builders can access wallet connect without a statsig account,
[context](https://valora-app.slack.com/archives/C025V1D6F3J/p1722383273562829))
- celo education url -> new item in app_config links

Note that the expanded pincode blocklist remote config flag doesn't
actually exist in the remote config console - so it is always defaulting
to false, so i've just removed the functionality.

Removed unused config:
- logPhoneNumberTypeEnabled
- pincodeUseExpandedBlocklist
- coinbasePayEnabled
- maxSwapSlippagePercentage
- networkTimeoutSeconds

### Test plan

n/a

### Related issues

- Related to RET-1272

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
)

### Description

Migrate `react-native-fs` to the `@divvi` fork in order to get rid of
the patch.

The patch changes are implemented in the fork:

itinance/react-native-fs@master...divvixyz:react-native-fs:master

### Additional notes

This library is not maintained anymore, so we have to migrate to another
one.

Possible alternatives (to consider in the future, as they aren't a
drop-in replacement):

*
[expo-file-system](https://docs.expo.dev/versions/latest/sdk/filesystem/)
(requires adding expo, which looks [cumbersome for a bare RN
project](https://docs.expo.dev/bare/installing-expo-modules/))
*
[@dr.pogodin/react-native-fs](https://dr.pogodin.studio/docs/react-native-file-system)(fork
of the original library, the docs are saying it is a drop-in
replacement, but it doesn't work that way)

### Test plan

* CI
* Next release App Store submission (patch is adding the
`PrivacyInfo.xcprivacy` file)

### Related issues

- Related to RET-1308

### Backwards compatibility

Y

### Network scalability

NA
### Description

This PR moves the following remote config variables to statsig dynamic
config:
- dapp list url -> app config
- dapp in-app webview enabled -> dapps webview config
- celo news -> app config
- swap price impact warning threshold -> swap config
- `maxNumRecentDapps` is no longer used and just removed here

### Test plan

n/a

### Related issues

- Related to RET-1272

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
### Description
Wrong translation was used on the SendConfirmation screen.

### Test plan
<img
src="https://github.com/user-attachments/assets/d3446e34-964b-4fa1-b82e-8011a2e7f6aa"
width="400" />

### Related issues
N/A

### Backwards compatibility
Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
### Description

To be similar with other usages

### Test plan

| Before | After |
|--------|--------|
| <img
src="https://github.com/user-attachments/assets/76fa2a6f-44c6-41d3-ae07-56addbeb4ea9"
width="250" /> | <img
src="https://github.com/user-attachments/assets/b39e1ea1-92f8-4ac0-93d3-92a7d8e3d17f"
width="250" /> |

### Related issues

N/A
### Description

This PR removes remote config for:
- allowOtaTranslations - this should be configured via the app config,
it seems unnecessary to remotely configure it given that it is a mature
feature now and unlikely needs to be switched off dynamically (an
equivalent action is to simply stop pushing OTA translations)
- sentryTracesSampleRate - we've never needed to change this value
- sentryNetworkErrors - we've never needed to change this value

Removing dynamic config for these allows us to simplify the
interdependencies of core dependencies, and the app init saga can work
more reliably.

### Test plan

n/a

### Related issues

- Related to RET-1272

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
…es` (valora-inc#6482)

### Description

Migrate `@react-native-cookies/cookies` to `@divvi/cookies`

The patch changes are implemented in the fork:

react-native-cookies/cookies@master...divvixyz:cookies:master

Although we are not using it directly, it is a [peer
dependency](https://github.com/fiatconnect/fiatconnect-sdk/blob/065ba70bd5dde23fa186d161072eb024e0cde40d/package.json#L56)
for `fiatconnect-sdk` (this package is already
[updated](fiatconnect/fiatconnect-sdk#330)).

### TODO

Migrate back to the original package once
react-native-cookies/cookies#189 is merged.

### Test plan

* CI
* Next release App Store submission (patch is adding the
`PrivacyInfo.xcprivacy` file)

### Related issues

- Related to RET-1308

### Backwards compatibility

Y

### Network scalability

NA
### Description

This PR removes the MULTICHAIN_FEATURES Statsig dynamic config variable.
It seems reasonable to assume that builders would not need the ability
to _dynamically_ change the network their app supports. It also seems
reasonable to assume that builders would want to support a whole network
fully, and thus the ability to control which networks have access to tx
feed / cico / approval transactions etc. seems unnecessary. With these
assumptions, the supported networks seem like they don't need to go
through Statsig at all.

This PR:
1. move the supported networks to config.ts but eventually this will be
app config that is passed in via the `createApp` config. access the
network ids via a central function (where we can read from config and
default to all networks if not provided)
2. remove MULTICHAIN_FEATURES dynamic config and util functions that
gate features by network (replacing all usages with a single
`getSupportedNetworkIds`)
3. update tests

The MULTICHAIN_FEATURES config was used when adding new networks,
however I assume that a different approach will be used if / when adding
new networks going forward since we would do this on the framework layer
(only allowing builders to access the new network once all
functionalities are supported)

### Test plan

n/a

### Related issues

- RET-1319

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
…#6488)

### Description

Update `react-native-keychain` to a divvi fork. It includes the patch
included in the replaced intera fork, and a new [Android build
fix](oblador/react-native-keychain#714)
addressing the [build
issue](https://github.com/divvixyz/divvi-mobile/actions/runs/13204494837/job/36864355193?pr=70)
in the divvi mobile monorepo.

Full diff with the original package:

oblador/react-native-keychain@master...mobilestack-xyz:react-native-keychain:divvi-fork

### TODO

Migrate to the original package once these PRs are included:
* oblador/react-native-keychain#712
* oblador/react-native-keychain#714

### Test plan

CI

### Related issues

- Related to RET-1308

### Backwards compatibility

Y

### Network scalability

NA
@bakoushin bakoushin changed the title sync with valora chore: sync with valora Feb 10, 2025
@bakoushin bakoushin force-pushed the valora-sync-2 branch 2 times, most recently from 8f7fcc0 to 016304c Compare February 10, 2025 16:22
@bakoushin bakoushin mentioned this pull request Feb 10, 2025
@bakoushin bakoushin force-pushed the valora-sync-2 branch 5 times, most recently from 1828f2b to 96b4c31 Compare February 10, 2025 17:46
@bakoushin bakoushin marked this pull request as ready for review February 10, 2025 18:08
Copy link

@jeanregisser jeanregisser left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks 🚀

Merged via the queue into main with commit 01b0d35 Feb 12, 2025
11 checks passed
@jeanregisser jeanregisser deleted the valora-sync-2 branch February 12, 2025 10:29
@jeanregisser
Copy link

Oops I squashed and merged instead of doing the merge 🤦

@jeanregisser jeanregisser restored the valora-sync-2 branch February 12, 2025 10:38
@jeanregisser jeanregisser deleted the valora-sync-2 branch February 12, 2025 10:41
@jeanregisser
Copy link

Redone with a merge commit in #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants