-
Notifications
You must be signed in to change notification settings - Fork 176
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: catch error transaction simulation failed for sol #635
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request updates two Vue components to incorporate network-specific behavior. In the swap-initiated component, the "Try again" link now appears only when the network is not Solana, while a new Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant SI as SwapInitiated Component
participant SBO as SwapBestOffer Component
U->>SI: Initiate swap action
SI->>SI: Check if network !== Solana
alt Network is not Solana
SI->>U: Render "Try again" link
else
SI->>U: Do not render "Try again" link
end
U->>SBO: Trigger sendAction
SBO->>SBO: Evaluate error in sendAction
alt Network is not Solana
SBO->>U: Display error message from error object
else Network is Solana
SBO->>SBO: Check for "Transaction simulation failed"
SBO->>U: Display user-friendly network issue message
end
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
💼 Build Files |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (1)
439-450
: Excellent error handling enhancement for Solana networks.This implementation improves the user experience by providing a more user-friendly error message when Solana transaction simulations fail, which addresses the PR objective. The condition properly checks for "Transaction simulation failed" in the error message and provides appropriate guidance to users.
Consider adding a comment explaining why this special handling is needed for Solana networks to help future developers understand the reasoning behind this conditional logic.
if (network.value!.name !== NetworkNames.Solana) { TXSendErrorMessage.value = err.error ? err.error.message : err.message; } else { + // Solana transaction simulation failures are often due to network congestion + // and not user error, so we provide a more user-friendly message TXSendErrorMessage.value = error.includes( 'Transaction simulation failed', ) ? 'Network may be busy. Please try again later.' : error; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/extension/src/ui/action/views/swap-initiated/index.vue
(3 hunks)packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: buildAll
- GitHub Check: test
🔇 Additional comments (5)
packages/extension/src/ui/action/views/swap-initiated/index.vue (3)
40-42
: Good implementation of network-specific behavior.This conditional rendering ensures the "Try again" link only appears for non-Solana networks, which is aligned with the PR objective of fixing error handling for Solana transaction simulation failures.
66-67
: LGTM: Necessary imports added.These imports provide the required types for the network-specific behavior implementation.
78-78
: LGTM: Essential prop addition.Adding the network prop to the interface ensures type safety and enables the conditional rendering functionality.
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (2)
95-95
: Good implementation: Network prop properly passed to child component.This change correctly passes the network information to the swap-initiated component, enabling network-specific behavior.
138-138
: LGTM: Required import added.Adding NetworkNames to the imports is necessary for the enhanced error handling implementation.
…into fix/solana-swap-error
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/swap/package.json (1)
25-40
: Production Dependencies Update in Swap.
Updates to@solana/spl-token
(^0.4.13
),rango-sdk-basic
(^0.1.64
),uuid
(^11.1.0
), andws
(^8.18.1
) should enhance compatibility and performance. Given the PR objective to catch simulation errors on Sol, please double-check that these changes do not inadvertently affect the transaction simulation logic on the Solana network.packages/hw-wallets/package.json (1)
50-63
: Hardware Wallet and Polkadot Dependency Upgrades.
Upgrading Ledger-related packages (@ledgerhq/hw-app-btc
to^10.6.0
and@ledgerhq/hw-app-eth
to^6.42.9
) along with Polkadot modules (@polkadot/types
to^15.8.1
and@polkadot/util
to^13.4.3
) is beneficial for ensuring compatibility with the latest wallet integrations and blockchain protocols. Running integration tests will help validate that transaction simulation and error-handling (especially for Solana-related flows) are correct.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (15)
package.json
(1 hunks)packages/extension-bridge/package.json
(1 hunks)packages/extension/package.json
(4 hunks)packages/hw-wallets/package.json
(2 hunks)packages/keyring/package.json
(1 hunks)packages/name-resolution/package.json
(2 hunks)packages/request/package.json
(1 hunks)packages/signers/bitcoin/package.json
(1 hunks)packages/signers/ethereum/package.json
(1 hunks)packages/signers/kadena/package.json
(1 hunks)packages/signers/polkadot/package.json
(1 hunks)packages/storage/package.json
(1 hunks)packages/swap/package.json
(1 hunks)packages/types/package.json
(1 hunks)packages/utils/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- packages/signers/ethereum/package.json
- packages/extension-bridge/package.json
- packages/signers/kadena/package.json
- packages/utils/package.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: buildAll
- GitHub Check: test
🔇 Additional comments (38)
package.json (1)
35-37
: Dependency Version Bump in devDependenciesThe versions for
"@commitlint/cli"
,"@commitlint/config-conventional"
, and"@swc/core"
have been updated to^19.8.0
,^19.8.0
, and^1.11.9
respectively. These upgrades are consistent with the project’s broader dependency update strategy. Please ensure that the updated tooling is fully verified in your test suite to avoid any potential regressions.packages/types/package.json (3)
27-27
: Updated @types/node VersionThe
"@types/node"
dependency has been updated to^22.13.10
. This aligns with similar updates in other packages and ensures consistency.
30-30
: ESLint and Prettier UpdatesThe
"eslint"
version is bumped to^9.22.0
and"prettier"
to^3.5.3
, which should help maintain up-to-date linting and formatting standards.
39-41
: TypeScript and Build Tool UpgradesThe updates for
"tsup"
,"typescript"
, and"typescript-eslint"
to^8.4.0
,^5.8.2
, and8.26.1
respectively are in line with the overall dependency updates. Make sure that after these bumps, the build process and type checking remain error‑free.packages/request/package.json (2)
30-31
: Updated Dependencies: uuid and wsThe dependency versions for
"uuid"
and"ws"
have been updated to^11.1.0
and^8.18.1
respectively. Since these are minor version bumps, they should be backward‑compatible; verifying their behavior during integration tests is recommended.
34-49
: Coherent Update of Dev DependenciesThe dev dependencies—including
"@types/node"
,"eslint"
,"prettier"
,"tsup"
,"typescript"
,"typescript-eslint"
, and"vitest"
—have all been updated to their newer versions. This consistency safeguards the development workflow. Please double‑check that all tests (especially those related to build and linting) pass after these upgrades.packages/storage/package.json (3)
30-30
: Updated @types/node DependencyThe
"@types/node"
version is now^22.13.10
, matching the revisions in the rest of the repository.
33-33
: ESLint Version UpdateThe
"eslint"
package has been bumped to^9.22.0
. This should keep linting configurations in sync with the latest rules—please verify that no new linting errors have surfaced.
39-45
: Consistent Dev Dependencies UpdatesThe updates for
"prettier"
,"tsup"
,"typescript"
,"typescript-eslint"
, and"vitest"
to^3.5.3
,^8.4.0
,^5.8.2
,8.26.1
, and^3.0.8
respectively are well aligned across the project. Confirm that these changes do not affect the local testing and build outputs.packages/signers/bitcoin/package.json (3)
35-35
: Updated @types/node DependencyThe
"@types/node"
is updated to^22.13.10
, ensuring uniformity with similar packages.
38-38
: ESLint Version BumpThe
"eslint"
package is now at^9.22.0
; please verify that the project’s lint configuration is fully compatible with the updated version.
44-50
: Consistent Dev Dependencies UpdatesThe updates to
"prettier"
,"tsup"
,"typescript"
,"typescript-eslint"
, and"vitest"
are consistent with those implemented in other packages. Ensure that these improvements do not introduce any unexpected issues in the build or test pipelines.packages/signers/polkadot/package.json (2)
24-31
: Production Dependency Version Upgrades.
The versions for@commitlint/cli
,@polkadot/util
, and@polkadot/util-crypto
have been updated to^19.8.0
and^13.4.3
, respectively. These changes ensure consistency with our workspace-wide updates. Please verify that these versions are compatible with all dependent packages.
32-50
: DevDependencies Update Consistency.
The updates for development tooling—ranging from@types/node
,eslint
,prettier
,tsup
,typescript
, totypescript-eslint
andvitest
—align with our broader dependency refresh effort across the monorepo. Ensure that local build, lint, and test commands execute without issues.packages/keyring/package.json (2)
24-35
: Aligned Production Dependencies.
Upgrading@polkadot/util
to^13.4.3
brings this package in line with recent dependency revisions across the project. Make sure that other modules relying on Polkadot utilities are similarly updated.
36-53
: DevDependencies Upgrades Verification.
The updates for@types/node
,eslint
,prettier
,tsup
,typescript
,typescript-eslint
, andvitest
are consistent with our coordinated dependency management. Please run the tests and linting workflow to verify that these newer versions do not introduce breaking changes.packages/name-resolution/package.json (2)
25-40
: DevDependencies Upgrade Consistency.
The updated development dependencies (including@types/node
,eslint
,prettier
,tsup
,typescript
,typescript-eslint
, andvitest
) align with our unified upgrade strategy. This consistency should help avoid version conflicts across packages.
49-54
: Production Dependency Update forethers
.
Upgradingethers
to^5.8.0
ensures that we benefit from the latest features and bug fixes. Verify that any downstream usage in the name resolution logic properly supports this update.packages/swap/package.json (1)
41-57
: DevDependencies Update in Swap Package.
The devDependencies—updating@types/node
,eslint
,prettier
,tsup
,typescript
,typescript-eslint
, andvitest
—are in harmony with our global version bumps. Ensure that the testing and linting processes run smoothly following these revisions.packages/hw-wallets/package.json (1)
24-41
: Updated DevDependencies in HW-Wallets.
The synchronization of dev tool versions (including@types/node
,eslint
,prettier
,tsup
,typescript
,typescript-eslint
, andvitest
) with our overall repository strategy is well-handled. Confirm that local development workflows (tests, linting, builds) are unaffected by these updates.packages/extension/package.json (18)
26-26
: Updated "@amplitude/analytics-browser" Version
The dependency version has been bumped to^2.11.13
(a patch update). Please review the changelog to ensure no unexpected changes affect the analytics integration.
39-40
: Updated Kadena Dependencies
"@kadena/client" and "@kadena/pactjs-cli" have been updated to^1.17.1
. Verify that these updates are compatible with your transaction simulation and error-handling logic—especially given the PR focus on catching transaction simulation errors on Sol.
44-45
: Updated Metaplex Dependencies
The versions for "@metaplex-foundation/umi" and "@metaplex-foundation/umi-bundle-defaults" have been updated to^1.1.1
. These changes should align with downstream component usage. Confirm that no breaking changes affect the Vue components relying on these packages.
46-53
: Updated Polkadot Dependencies
Multiple Polkadot packages (e.g.,@polkadot/api
,@polkadot/extension-inject
,@polkadot/keyring
, etc.) are now using newer patch versions. It is important to verify that these updates do not interfere with existing functionality or integrations within the extension.
55-56
: Updated Solana Dependencies
The versions for "@solana-developers/helpers" and "@solana/spl-token" have been updated. Given the PR title’s focus on handling Solana error transactions, ensure these upgrades are tested against the new network-specific error handling logic.
80-80
: Updated "uuid" Dependency
The "uuid" package is now at^11.1.0
. This is a minor bump, but please verify that any usage of UUIDs in the project remains consistent with the updated API (if applicable).
92-93
: Updated CRXJS and Rollup CommonJS Plugin
Dev dependencies "@crxjs/vite-plugin" and "@rollup/plugin-commonjs" have been updated. These should provide bug fixes and performance improvements for your build process.
96-96
: Updated Rollup Node Resolve Plugin
The upgrade to "@rollup/plugin-node-resolve" at^16.0.1
might affect module resolution. Verify bundler configurations and test the build process to ensure compatibility.
102-102
: Updated Chrome Type Definitions
"@types/chrome" has been updated to^0.0.309
. Make sure that this change does not introduce any type conflicts in your extension’s Chrome-specific code.
107-108
: Updated Type Definitions for Lodash and Node
The updates to "@types/lodash" and "@types/node" should improve type safety and compatibility. It’s advisable to run a full type check to catch any potential issues.
116-116
: Updated Vue ESLint Config for TypeScript
The dependency "@vue/eslint-config-typescript" now uses^14.5.0
, which should enhance linting for TypeScript in Vue. Confirm that your ESLint rules are still correctly enforced.
118-118
: Updated VueUse Core
"@vueuse/core" has been updated to^12.8.2
. Please verify that any composable functions or utilities used in your Vue components continue to behave as expected.
120-121
: Updated ESLint and ESLint Plugin for Vue
The versions for "eslint" and "eslint-plugin-vue" have been updated. These updates are critical for maintaining robust static analysis. Double-check your ESLint configuration to ensure consistency after these changes.
127-127
: Updated Prettier Version
Prettier is now at^3.5.3
. This upgrade might introduce minor formatting changes. Ensure that any pre-commit hooks or formatting rules are adjusted accordingly.
129-129
: Updated Rollup Version
Rollup has been updated to^4.35.0
. Validate that your bundling configuration produces the expected output without introducing regressions.
133-134
: Updated TSup and TypeScript
The updates to "tsup" (^8.4.0
) and "typescript" (~5.8.2
) require a careful review of the build and type-checking pipeline. Please run a complete build and type-check to confirm stability.
136-136
: Updated Vite Version
Vite is now using^6.2.1
. Make sure that this upgrade is compatible with your current plugin ecosystem and does not affect development or production builds.
139-140
: Updated Vitest and Vue TSC
The testing and type-checking tools ("vitest" and "vue-tsc") have been updated. It is important to run your test suite and check for any new type errors or test failures as a result.
Summary by CodeRabbit