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

Fix send sheet stuck on loading #6119

Merged
merged 9 commits into from
Sep 20, 2024
Merged

Fix send sheet stuck on loading #6119

merged 9 commits into from
Sep 20, 2024

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Sep 19, 2024

Fixes APP-1879

What changed (plus any additional context for devs)

A boundary check we added prevented the initial render to perform gas estimations on the network. Will put up a follow up PR that converts the SendSheet over to typescript so we can quit messing up sends.

Screen recordings / screenshots

Screen.Recording.2024-09-19.at.4.10.51.PM.mp4

What to test

send flow e2e

Copy link

linear bot commented Sep 19, 2024

src/screens/SendSheet.js Outdated Show resolved Hide resolved
@brunobar79
Copy link
Member

Launch in simulator or device for b567361

@brunobar79
Copy link
Member

Launch in simulator or device for d8292db

@brunobar79
Copy link
Member

Launch in simulator or device for 26b15d9

@@ -48,7 +48,7 @@ export default function CheckboxField({
</Box>
<Box flexShrink={1}>
<AccentColorProvider color={customColor || action}>
<Text color={isChecked ? 'accent' : 'secondary80 (Deprecated)'} size="16px / 22px (Deprecated)" weight="bold">
<Text color={isChecked ? 'accent' : 'secondary80 (Deprecated)'} size="15pt" weight="bold">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for L2s this was overflowing onto the next line for Android so that's why I made this change for context. Not a super good fix but it's a patch

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this is somehow affecting iOS. Maybe safer to wrap in a platform check and keep ios the same?

@@ -117,17 +117,15 @@ export default function SendHeader({
const isPreExistingContact = (contact?.nickname?.length || 0) > 0;

const name =
removeFirstEmojiFromString(userWallet?.label || contact?.nickname || nickname) || userWallet?.ens || contact?.ens || recipient;
removeFirstEmojiFromString(contact?.nickname || userWallet?.label || nickname) || userWallet?.ens || contact?.ens || recipient;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you assigned a nickname to a contact it was never for wallets that had ENS names

let color = '';
const nickname = !isHexString(name) ? name : '';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we only want nicknames prefilled for ENS related names.

@@ -162,7 +160,7 @@ export default function SendHeader({
address: hexAddress,
nickname: name,
onDelete: () => {
onChangeAddressInput(contact?.ens);
onChangeAddressInput(contact?.ens ? contact?.ens : contact?.address);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay so basically this was triggering a setToAddress of '' for non-ENS accounts, which threw us into a never ending loading state until you reselected the account you want to send to.

@@ -420,7 +420,7 @@ export const SendConfirmationSheet = () => {
return existingAcct;
}, [toAddress, userAccounts, watchedAccounts]);

let avatarName = removeFirstEmojiFromString(existingAccount?.label || contact?.nickname);
let avatarName = removeFirstEmojiFromString(contact?.nickname || existingAccount?.label);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay similarly to the other instance of this, we were never showing contact nicknames for accounts with ens names since we always preferred ens names over contact nicknames.

@@ -713,8 +713,8 @@ export default function SendSheet(props) {
const isValid = checkIsValidAddressOrDomainFormat(text);
if (!isValid) {
setIsValidAddress();
setToAddress();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should only reset the toAddress here if it's not valid.

Comment on lines +815 to +820
const filteredUserAccountsFromContacts = useMemo(() => {
return userAccounts.filter(
account => !filteredContacts.some(contact => contact.address.toLowerCase() === account.address.toLowerCase())
);
}, [userAccounts, filteredContacts]);

Copy link
Contributor Author

@walmat walmat Sep 19, 2024

Choose a reason for hiding this comment

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

fixes not showing the account in the user wallets list if it exists in the contacts list

@walmat walmat requested a review from brunobar79 September 19, 2024 20:16
Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

fixes look good 👍🏽

Copy link
Member

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

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

🤝🤝🤝

@@ -48,7 +48,7 @@ export default function CheckboxField({
</Box>
<Box flexShrink={1}>
<AccentColorProvider color={customColor || action}>
<Text color={isChecked ? 'accent' : 'secondary80 (Deprecated)'} size="16px / 22px (Deprecated)" weight="bold">
<Text color={isChecked ? 'accent' : 'secondary80 (Deprecated)'} size="15pt" weight="bold">
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this is somehow affecting iOS. Maybe safer to wrap in a platform check and keep ios the same?

@brunobar79
Copy link
Member

Launch in simulator or device for 36fdfce

@brunobar79
Copy link
Member

Launch in simulator or device for 0128c14

@brunobar79 brunobar79 merged commit ed06d93 into develop Sep 20, 2024
8 checks passed
@brunobar79 brunobar79 deleted the @matthew/APP-1879 branch September 20, 2024 00:37
ibrahimtaveras00 pushed a commit that referenced this pull request Sep 20, 2024
* fix stuck loading phase

* Update src/screens/SendSheet.js

* fix deleting contact resetting toAddress to undefined

* fix some shit with ens names

* rm logs

* fix failed to send

* fix lint

* prefer contact name over wallet label

* force linter 2 re-rerun

---------

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>
greg-schrammel pushed a commit that referenced this pull request Oct 16, 2024
* fix stuck loading phase

* Update src/screens/SendSheet.js

* fix deleting contact resetting toAddress to undefined

* fix some shit with ens names

* rm logs

* fix failed to send

* fix lint

* prefer contact name over wallet label

* force linter 2 re-rerun

---------

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>
greg-schrammel added a commit that referenced this pull request Oct 22, 2024
* sortDirection

* asc/desc menu

* imports

* imports

* i18n

* Merge remote-tracking branch origin/develop into gregs/app-1756-sorting-nfts-on-android-is-broken

* Merge remote-tracking branch origin/develop into gregs/app-1756-sorting-nfts-on-android-is-broken

* fix types

* update ts

* add back isAnchoredToRight

* ??

* grey out the selected option

* android

* Fix iOS 18 cool-modals context menu bug (#6112)

* Fix send crashes / blank screen (#6116)

* Fix disabled paste button on Android (#6118)

* imageVariants (#6114)

* Fix send sheet stuck on loading  (#6119)

* fix stuck loading phase

* Update src/screens/SendSheet.js

* fix deleting contact resetting toAddress to undefined

* fix some shit with ens names

* rm logs

* fix failed to send

* fix lint

* prefer contact name over wallet label

* force linter 2 re-rerun

---------

Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>

* Support typing into native inputs in swap (#6100)

* Remove unused TODO as build quote params should always rely on the corresponding input output amounts even if native values are updated

* Support input native changes in swap inputs controller animated reaction

* Temp cleanup on SwapInputAsset to pull out SwapInputAmountCaret and SwapInputNativeAmount

* Temp cleanup on SwapOutputAsset to pull out SwapOutputAmountCaret and SwapOutputNativeAmount

* Placeholder: generic SwapInputValuesCaret that still need to be hooked up with native inputs

* Add caret animatedStyle to SwapInputValuesCaret

* Use SwapInputValuesCaret component in SwapInputAsset and SwapOutputAsset

* Remove old input and output caret styles from useSwapTextStyles

* Cleanup of unused imports in swaps types

* Add assetToSellCaretStyle and assetToBuyCaretStyle to caret component

* Remove now unused assetToSell/BuyCaretStyles from useAnimatedSwapStyles

* Update native input in SwapInputAsset to be typeable

* Define size style for native caret in SwapInputValuesCaret

* Update swap number pad

Remove formatting that isn't a decimal or number on inputs.
Previously, we were removing only commas, but now that we support native
inputs, we want to remove the native currency symbols.

Prevent updating of the native inputs if their is no corresponding price
for the input / output asset.

* Create separate SwapNativeInput component

* Remove unused caret styles from SwapInputAsset and SwapOutputAsset

* Add param to ignore alignment for native currency formatting and add handler for basic currency formatting

* Update width on nativeCaret

* Add support for changes to native output value

* Fix missing checks for inputNativeValue and outputNativeValue

* Split native currency symbol from value in native input component

* Disable caret when correponding asset does not have price for native input

* Update formatting for input amount if input method is native inputs

* Disable pointer events when no price on native inputs

* Distinguish between placeholder values vs typed inputs for native input values

* Update checks for color for zero value in swap text styles

* Disable focus and pointer events on native output if output based quotes disabled

* Support showing explainer if output quotes disabled and user tries to update output native amount

* Ignore native input changes if native currency decimals exceeded

* Update add decimal in swap number pad to also handle scenarios where there are no native currency decimals

* Update South Korea and Japan currencies as they do not use decimals

* Fix numbers test after JPY decimal changes

* Update numbers test value which should get rounded up

* Fix: check for native placeholder value while checking native input decimal places

* Fix chainId not being passed in for dapp browser getProvider function (#6121)

* Update rainbow provider package to latest 0.1.1

* Fix: getProvider function needs to use an object param

* Cleanup

* Update arbitrum default back to mainnet for WC message signing (#6122)

* Bump deps for Xcode 16 compatibility (#6110)

* RN upgrade

* update ios files

* fixes for android

* iOS working fine

* bump sentry again

* patches and missing dep bump

* bump more deps

* update lockfile

* fix android

* changes to pbxproj

* revert RN upgrade

* new line missing

* force linter 2 re-rerun

* update pod lock

* bump iOS and Android to v1.9.40 (#6131)

* Update CI to work with Xcode 16 / iOS 18 (#6129)

* omit_from_total (#6103)

* Fix speed up and cancel bug (#6133)

* change txTo -> to

* idk

* bump iOS and Android to v1.9.41 (#6136)

* MWP (#6142)

* mwp compat

* prettier

* log only if there is an error

* Dapp browser url updates fix (#6150)

* remove unused import

* restrict JS nav from SPA to same domain

* clean up

* Update src/components/DappBrowser/BrowserTab.tsx

* Internal networks filtering (#6148)

* filter internal networks out

* rm apechains refs

* Fix token search crash for newly added chains (#6147)

* fix token search crash

* rm assets

* Claimables [PR #1]: updates to query, types, utils, wallet screen rendering logic + wallet screen components (#6140)

* updates to query, types, & wallet screen components

* rm onPress

* thanks greg

* Fix improper gas fee calculation (#6125)

* add missing mul to eip1559

* use preferred network if available

* another NaN check guard

* Claimables [PR #2]: claim panel ui (#6141)

* raps

* nit

* comments

* nit

* nit

* prettier

* updates to query, types, & wallet screen components

* rm onPress

* rm logic

* claim panel ui

* nav

* onPress -> onLongPress

* i18n

* pending state, i18n

* comment

* shimmer

* tweak gas fee formatting

* number formatting

* wallet screen number format

* route types

* do not require long press for goBack

* tweak button text

* nit

* formatting

* thanks greg

* revert

* fix android button width

* rm memo

* try catch gas

* rm functionality from tx

* rm rapsv2

* raps v2 (#6138)

* raps

* nit

* comments

* nit

* nit

* prettier

* updates to query, types, & wallet screen components

* rm onPress

* rm logic

* thanks greg

* Claimables [PR #3]: claim functionality (#6146)

* raps

* nit

* comments

* nit

* nit

* prettier

* updates to query, types, & wallet screen components

* rm onPress

* rm logic

* claim panel ui

* nav

* onPress -> onLongPress

* i18n

* pending state, i18n

* comment

* shimmer

* functionality

* tweak gas fee formatting

* number formatting

* wallet screen number format

* route types

* set pending state if no tx hash

* do not require long press for goBack

* tweak button text

* nit

* fix pending tx

* disable read only wallet

* formatting

* thanks greg

* revert

* fix android button width

* rm memo

* try catch gas

* rm functionality from tx

* [APP-1907] Add Claiming Status to Pending Claimable TX's (plus types and unused code cleanup) (#6155)

* fix: use claim type for pending claimable tx

* [APP-1909] Await Claimable TX Before Resolving Rap (#6156)

* fix: await claimable tx mining before displaying success

* fix: add pending tx prior to waiting for mining

* Claimables fixes (#6158)

* number formatting

* fix border radius for claim dapp icon

* poll gas by chain id

* haptics

* adjust button enabled logic + shadows

* fix (#6159)

* convert sends to typescript (#6120)

* convert sends to typescript

* more conversions

* fix lint

* fix optimism security fee

* fix file renaming weirdness

* fix rotation from max asset to nft not working

* fix some typescript bs

* fix lint

* fix nft sends

* comments watchdog action (#6153)

* pod unlock (#6168)

* Fix WalletconnectV2 changeAccount issues (#6160)

* fix wc v2 change account issues

* Update src/walletConnect/index.tsx

* Update src/components/walletconnect-list/WalletConnectV2ListItem.tsx

* Update src/components/walletconnect-list/WalletConnectV2ListItem.tsx

* fix deps array

* bump android and iOS to version v1.9.42 (#6170)

* fix approval sheet not using verifiedData incoming from walletconnect (#6162)

* network expansion  (#6149)

* init apechain support

* fix wrong images

* Apply suggestions from code review

* Update chain badge

* Update chain colors

* Add all badge assets

* add backend networks runtime

* added back internal flag

* remove unused NATIVE_ASSETS_PER_CHAIN

* fix some discrepancies

---------

Co-authored-by: Christian Baroni <7061887+christianbaroni@users.noreply.github.com>

* Analytics changes (#6169)

* analytics changes

* idk

* watched wallets cohort + properly track watched wallets

* [CHORE]: Walletconnect Approval / Redirect sheet typescript conversion (#6167)

* wc ts conversion

* remove memo and fix lint

* nft expanded state fix crash (#6115)

* fix crash

* destructure in same line

* fix lint issues on develop (#6174)

* Fix MWP from failing to prompt if dapp metadata retrieval fails (#6164)

* prevent mwp flow from failing if failed to fetch dapp metadata

* prevent logging user rejections

* ignore logging some user errors

* lel wtf (#6166)

* WC migration to WalletKit (#6163)

* Fix networks crash (#6176)

* fix networks crash

* remove duplicated walletconnect chain ids

* use all supported chains for walletconnect

* fix weird space on approval sheet

* Update src/screens/WalletConnectApprovalSheet.tsx

* hide send button when not transferable (#6123)

* Claim button fixes (#6165)

* hold -> tap

* debounce

* fix lint (#6180)

* chore: use new fields from swap sdk and remove extraneous code (#6171)

* chore: update swaps

* chore: replace extraneous crosschain logic with needsAllowance field

* chore: get rid of all WRAPPED_ASSET references and use quote swap type

* chore: remove swapType as a param to get quotes

* chore: replace swap unlock logic with needsAllowance field

* chore: code review changes

* Zeego Dropdown Menus [MintFilters] (#6143)

* zeego setup

* bump react-native-menu/menu

* fix android settings menu

* update deps

* fix type inference

* mvp to fix android context menus

* fix some inconsistencies on Android

* remove debug logs

* Update src/components/asset-list/RecyclerAssetList2/core/RawRecyclerList.tsx

* Update src/components/DropdownMenu.tsx

* remove unused deps

* fix build maybe

* update lock

* Claim bug fix (#6182)

* fixes

* fix experimental config usage

* nits

* use setTimeout

* defaultConfig fix

* fix ledger image blocking text

* 👍

* lint

* lint

---------

Co-authored-by: Christian Baroni <7061887+christianbaroni@users.noreply.github.com>
Co-authored-by: Matthew Wall <matthew.wallt@gmail.com>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>
Co-authored-by: Jin <jin.chung17@gmail.com>
Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com>
Co-authored-by: Ibrahim Taveras <ibrahim@rainbow.me>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Christopher Howard <derhowiedesigns@gmail.com>
Co-authored-by: Wayne Cheng <677680+welps@users.noreply.github.com>
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.

4 participants