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

[ENG-3496] fix: utxo 500 issue add a fallback option to our api httpsbtc #738

Conversation

teebszet
Copy link
Member

@teebszet teebszet commented Jan 5, 2024

πŸ”˜ PR Type

  • Enhancement

πŸ“œ Background

Issue Link: ENG-3496
depends on: secretkeylabs/xverse-core#339

πŸ”„ Changes

  • added an (optional) input to change network screen for fallback btc api url. it can be saved with an empty input
  • fixed the UX so that switching between mainnet/testnet will remember previously set urls
  • renamed the Reset URL button to 'Reset to default'
  • added a quick validation for BTC URL and Stacks URL inputs, to not allow empty
  • uses core version [ENG-3496] fix: utxo 500 issue add a fallback option to our api httpsbtcΒ xverse-core#339 where BitcoinEsploraApiProvider will retry on the fallbackUrl (if provided) on:
    • request timeouts
    • response 4xx 5xx codes
  • some minor restyling on the change network screen
    • use the revamped feedback errors
    • use the revamped input 'X' button (cross in circle icon)

Impact:

  • anywhere useBtcClient was used, will have a fallback url, which is configurable from the settings screen
    • can verify this by triggering calls to btcclient and checking the baseURL of the network requests
    • btcclient is used in sendBtc, sendOrdinal, sendRareSats, restoreOrdinal, sendBrc20, btcRbf, transaction history, sign psbt request, edit btc fees, one step brc20, create inscription
  • note that BitcoinEsploraApiProvider needs to still be used without the fallback url, when validating each custom URL input (on the change network screen itself)

πŸ–Ό Screenshot / πŸ“Ή Video

Screen.Recording.2024-01-09.at.6.58.36.PM.mov

βœ… Review checklist

Please ensure the following are true before merging:

  • Code Style is consistent with the project guidelines.
  • Code is readable and well-commented.
  • No unnecessary or debugging code has been added.
  • Security considerations have been taken into account.
  • The change has been manually tested and works as expected.
  • Breaking changes and their impacts have been considered and documented.
  • Code does not introduce new technical debt or issues.

@teebszet teebszet changed the title Tim/eng 3496 fix utxo 500 issue add a fallback option to our api httpsbtc [ENG-3496] fix: utxo 500 issue add a fallback option to our api httpsbtc Jan 5, 2024
@teebszet teebszet marked this pull request as ready for review January 9, 2024 08:43
@teebszet teebszet marked this pull request as draft January 9, 2024 09:02
@teebszet teebszet marked this pull request as ready for review January 9, 2024 11:00
tsconfig.json Outdated Show resolved Hide resolved
Copy link
Member

@victorkirov victorkirov left a comment

Choose a reason for hiding this comment

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

I left a thread of comments but maybe the idea is to not use the URL value from the config endpoint? If that's the case, then I'm happy to approve πŸ‘

@teebszet
Copy link
Member Author

I left a thread of comments but maybe the idea is to not use the URL value from the config endpoint? If that's the case, then I'm happy to approve πŸ‘

I asked @m-aboelenein here: https://secretkeylabs.slack.com/archives/C05QCJM9D1N/p1704804634811279

and looks like we can remove that functionality

victorkirov
victorkirov previously approved these changes Jan 10, 2024
Copy link
Member

@victorkirov victorkirov left a comment

Choose a reason for hiding this comment

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

So much cleaner! πŸŽ‰

@DuskaT021
Copy link
Contributor

@teebszet needs conflicts resolved

@teebszet
Copy link
Member Author

@DuskaT021 done!

Copy link

@teebszet teebszet merged commit c5b32b5 into develop Jan 11, 2024
5 checks passed
This was referenced Jan 11, 2024
@teebszet teebszet deleted the tim/eng-3496-fix-utxo-500-issue-add-a-fallback-option-to-our-api-httpsbtc branch January 12, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants