-
Notifications
You must be signed in to change notification settings - Fork 149
Main -> develop #5926
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
Main -> develop #5926
Conversation
* fix(quote): update quote when expired * fix(quote): update quote when expired * fix(quote): stop polling when trade is not ready * fix: do not update quote when wallet is not connected
chore(release): 2025-07-02
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
|
""" WalkthroughThis update implements version bumps across multiple applications and libraries, introduces and propagates the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TradeWidgetForm
participant useIsQuoteUpdatePossible
participant TradeQuoteUpdater
participant useTradeQuotePolling
User->>TradeWidgetForm: Interacts with trade form
TradeWidgetForm->>useIsQuoteUpdatePossible: Check if quote update is possible
useIsQuoteUpdatePossible-->>TradeWidgetForm: Return boolean flag
TradeWidgetForm->>TradeQuoteUpdater: Render with isQuoteUpdatePossible
TradeQuoteUpdater->>useTradeQuotePolling: Poll quote if allowed
useTradeQuotePolling-->>TradeQuoteUpdater: Handle polling, expiration, etc.
sequenceDiagram
participant Wallet
participant switchChain
participant chainInfo
participant eip155Label
Wallet->>switchChain: Request chain switch
switchChain->>chainInfo: Retrieve chain info
chainInfo-->>switchChain: Provide eip155Label and RPC URLs
switchChain->>Wallet: Use eip155Label as chainName, set up RPC
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
CodeRabbit Configuration File (
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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: 2
🧹 Nitpick comments (9)
libs/ui/package.json (1)
3-3: UI package version update okThe shift to
1.25.0aligns with the new UI features. Confirm that the related STORYBOOK / docs site reflects the new banner & proxy components under this version.libs/core/package.json (1)
3-3: Core bumped to 1.7.4Given this is a bug-fix release, consider labelling it
1.7.4in the root changelog summary so consumers quickly spot the fix. Otherwise, all good.libs/tokens/CHANGELOG.md (1)
3-9: Minor wording nitpickConsider re-phrasing the feature line for consistency with previous entries (they usually start with a verb):
-* **bridge:** display account proxy +* **bridge:** Display account proxyCapitalising the verb keeps style uniform across the document.
libs/multicall/CHANGELOG.md (1)
3-9: Consistent feature descriptionSame stylistic nitpick as in
libs/tokens– capitalise the first verb for consistency.-* **bridge:** display account proxy +* **bridge:** Display account proxyapps/cowswap-frontend/src/modules/tradeFormValidation/index.ts (1)
3-3: Barrel export may unintentionally shadow the singular hookExporting both
useGetTradeFormValidationanduseGetTradeFormValidationsfrom the same barrel is fine, but the almost-identical names can easily be confused in imports and auto-completion.
Consider renaming one of them (e.g.useGetFirstTradeFormValidation) or adding JSDoc in the individual files clarifying the distinction to avoid future mix-ups.apps/cow-fi/CHANGELOG.md (1)
3-12: Minor nit: truncated commit subjectThe first bullet point cuts off with “swap w…”. If the commit message was truncated by mistake, expand it so the changelog remains self-contained.
apps/cowswap-frontend/src/modules/tokensList/utils/mapChainInfo.ts (1)
12-13: Hard-coding only Sepolia as testnet
isTestnetistruesolely forSEPOLIA, overlooking other testnets you already support (e.g. Goerli, Holesky).
If intentional, add a comment; otherwise consider a helper likeisTestChain(chainId).apps/cowswap-frontend/CHANGELOG.md (2)
10-11: Fix typos & align bullet-style with the rest of the file
walllet→wallet- Prepend the usual scope prefix (
**wallet:**) for consistency.-* use `eip155` chain names adding chain parameter to walllet ([#5916](https://github.com/cowprotocol/cowswap/issues/5916)) ([318c1bc](https://github.com/cowprotocol/cowswap/commit/318c1bcbb7528fdd3abf233068cebfff371dbea9)) +* **wallet:** use `eip155` chain names, adding chain parameter to wallet ([#5916](https://github.com/cowprotocol/cowswap/issues/5916)) ([318c1bc](https://github.com/cowprotocol/cowswap/commit/318c1bcbb7528fdd3abf233068cebfff371dbea9))
16-17: Minor typo: “udpate” → “update”-* **limit-orders:** udpate quote when back from confirm ([#5922](https://github.com/cowprotocol/cowswap/issues/5922)) ([f3d721e](https://github.com/cowprotocol/cowswap/commit/f3d721eda45506f77ae3564f447994e87d9cd445)) +* **limit-orders:** update quote when back from confirm ([#5922](https://github.com/cowprotocol/cowswap/issues/5922)) ([f3d721e](https://github.com/cowprotocol/cowswap/commit/f3d721eda45506f77ae3564f447994e87d9cd445))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (46)
.release-please-manifest.json(1 hunks)apps/cow-fi/CHANGELOG.md(1 hunks)apps/cow-fi/package.json(1 hunks)apps/cowswap-frontend/CHANGELOG.md(1 hunks)apps/cowswap-frontend/package.json(1 hunks)apps/cowswap-frontend/src/modules/tokensList/utils/mapChainInfo.ts(1 hunks)apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetForm.tsx(3 hunks)apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetUpdaters.tsx(3 hunks)apps/cowswap-frontend/src/modules/trade/hooks/useIsQuoteUpdatePossible.ts(1 hunks)apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidation.ts(1 hunks)apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidations.ts(1 hunks)apps/cowswap-frontend/src/modules/tradeFormValidation/index.ts(1 hunks)apps/cowswap-frontend/src/modules/tradeFormValidation/services/validateTradeForm.ts(3 hunks)apps/cowswap-frontend/src/modules/tradeQuote/hooks/usePollQuoteCallback.ts(3 hunks)apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuoteManager.ts(1 hunks)apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.test.tsx(2 hunks)apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts(5 hunks)apps/cowswap-frontend/src/modules/tradeQuote/updaters/TradeQuoteUpdater/index.tsx(1 hunks)apps/cowswap-frontend/src/modules/tradeQuote/utils/quoteDeadline.ts(2 hunks)apps/explorer/CHANGELOG.md(1 hunks)apps/explorer/package.json(1 hunks)libs/balances-and-allowances/CHANGELOG.md(1 hunks)libs/balances-and-allowances/package.json(1 hunks)libs/common-const/CHANGELOG.md(1 hunks)libs/common-const/package.json(1 hunks)libs/common-const/src/chainInfo.ts(3 hunks)libs/common-hooks/CHANGELOG.md(1 hunks)libs/common-hooks/package.json(1 hunks)libs/common-utils/CHANGELOG.md(1 hunks)libs/common-utils/package.json(1 hunks)libs/core/CHANGELOG.md(1 hunks)libs/core/package.json(1 hunks)libs/hook-dapp-lib/CHANGELOG.md(1 hunks)libs/hook-dapp-lib/package.json(1 hunks)libs/multicall/CHANGELOG.md(1 hunks)libs/multicall/package.json(1 hunks)libs/tokens/CHANGELOG.md(1 hunks)libs/tokens/package.json(1 hunks)libs/types/CHANGELOG.md(1 hunks)libs/types/package.json(1 hunks)libs/ui/CHANGELOG.md(1 hunks)libs/ui/package.json(1 hunks)libs/wallet/CHANGELOG.md(1 hunks)libs/wallet/package.json(1 hunks)libs/wallet/src/web3-react/utils/switchChain.ts(3 hunks)package.json(2 hunks)
🧰 Additional context used
🧠 Learnings (26)
apps/cowswap-frontend/package.json (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.test.tsx (2)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
libs/balances-and-allowances/CHANGELOG.md (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
libs/common-hooks/CHANGELOG.md (2)
Learnt from: fairlighteth
PR: cowprotocol/cowswap#5780
File: CONTRIBUTING.md:121-121
Timestamp: 2025-06-02T12:52:34.606Z
Learning: React 19.0.0 was released on December 5, 2024, introducing new features like Actions, Server Components, and hooks such as useActionState and useOptimistic.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
apps/cowswap-frontend/src/modules/tradeFormValidation/index.ts (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
libs/common-const/CHANGELOG.md (1)
Learnt from: cowdan
PR: cowprotocol/cowswap#5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
libs/common-utils/CHANGELOG.md (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
libs/hook-dapp-lib/CHANGELOG.md (2)
Learnt from: fairlighteth
PR: cowprotocol/cowswap#5780
File: CONTRIBUTING.md:121-121
Timestamp: 2025-06-02T12:52:34.606Z
Learning: React 19.0.0 was released on December 5, 2024, introducing new features like Actions, Server Components, and hooks such as useActionState and useOptimistic.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
libs/wallet/CHANGELOG.md (1)
Learnt from: cowdan
PR: cowprotocol/cowswap#5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
apps/cow-fi/CHANGELOG.md (1)
Learnt from: cowdan
PR: cowprotocol/cowswap#5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
apps/cowswap-frontend/src/modules/tradeQuote/utils/quoteDeadline.ts (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
libs/ui/CHANGELOG.md (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
libs/tokens/CHANGELOG.md (1)
Learnt from: cowdan
PR: cowprotocol/cowswap#5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidations.ts (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
libs/core/CHANGELOG.md (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
apps/cowswap-frontend/src/modules/trade/hooks/useIsQuoteUpdatePossible.ts (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetForm.tsx (3)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
Learnt from: fairlighteth
PR: cowprotocol/cowswap#5782
File: apps/cow-fi/app/(learn)/learn/topics/page.tsx:1-1
Timestamp: 2025-06-05T08:31:01.284Z
Learning: Next.js App Router official documentation states that Client Components marked with 'use client' should NOT be declared as async functions, as this can lead to infinite loops or application hangs. The recommended pattern for async operations in Client Components is to use useEffect hooks. Server Components (without 'use client') can be async, which might be a source of confusion.
apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidation.ts (2)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetUpdaters.tsx (3)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5549
File: apps/cowswap-frontend/src/modules/tradeFlow/services/safeBundleFlow/safeBundleEthFlow.ts:152-152
Timestamp: 2025-04-02T09:58:29.374Z
Learning: In the `safeBundleEthFlow` function, `account` is guaranteed to be truthy based on the type system (`PostOrderParams` defines it as a required string) and the context in which the function is called, so additional runtime checks are unnecessary.
libs/wallet/src/web3-react/utils/switchChain.ts (1)
Learnt from: cowdan
PR: cowprotocol/cowswap#5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/usePollQuoteCallback.ts (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuoteManager.ts (2)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
apps/cowswap-frontend/CHANGELOG.md (2)
undefined
<retrieved_learning>
Learnt from: shoom3301
PR: #5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
</retrieved_learning>
<retrieved_learning>
Learnt from: cowdan
PR: #5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
</retrieved_learning>
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts (3)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
Learnt from: alfetopito
PR: cowprotocol/cowswap#5532
File: libs/common-hooks/src/useOnScroll.tsx:22-38
Timestamp: 2025-03-25T10:03:35.157Z
Learning: In React useEffect hooks, refs (RefObjects) should generally be included in dependency arrays even though changes to ref.current don't trigger effects. This is because the ref object itself could change between renders (especially in custom hooks where refs are passed as parameters), and it follows React's best practice of including all external values used in the effect.
apps/cowswap-frontend/src/modules/tradeQuote/updaters/TradeQuoteUpdater/index.tsx (2)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5859
File: apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts:76-82
Timestamp: 2025-06-23T07:03:50.760Z
Learning: In the useTradeQuotePolling hook, there are two useLayoutEffect hooks that work together: one resets the counter to 0 when the confirmation modal closes, and another automatically triggers pollQuote(false, true) whenever the counter reaches 0. This creates an intentional chain reaction for immediate quote updates.
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
.release-please-manifest.json (1)
Learnt from: shoom3301
PR: cowprotocol/cowswap#5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.
🧬 Code Graph Analysis (7)
apps/cowswap-frontend/src/modules/trade/hooks/useIsQuoteUpdatePossible.ts (1)
apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidations.ts (1)
useGetTradeFormValidations(10-14)
apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidation.ts (1)
apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidations.ts (1)
useGetTradeFormValidations(10-14)
apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetUpdaters.tsx (2)
apps/cowswap-frontend/src/modules/trade/hooks/useIsQuoteUpdatePossible.ts (1)
useIsQuoteUpdatePossible(12-16)apps/cowswap-frontend/src/modules/tradeQuote/updaters/TradeQuoteUpdater/index.tsx (1)
TradeQuoteUpdater(12-20)
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuoteManager.ts (1)
apps/cowswap-frontend/src/modules/tradeQuote/state/tradeQuoteInputAtom.ts (1)
SellTokenAddress(5-5)
apps/cowswap-frontend/src/modules/tradeFormValidation/services/validateTradeForm.ts (2)
apps/cowswap-frontend/src/modules/tradeFormValidation/types.ts (1)
TradeFormValidationContext(63-63)libs/common-utils/src/legacyAddressUtils.ts (1)
isAddress(11-17)
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts (2)
apps/cowswap-frontend/src/modules/tradeQuote/hooks/usePollQuoteCallback.ts (1)
usePollQuoteCallback(18-82)apps/cowswap-frontend/src/modules/tradeQuote/utils/quoteDeadline.ts (1)
isQuoteExpired(16-39)
apps/cowswap-frontend/src/modules/tradeQuote/updaters/TradeQuoteUpdater/index.tsx (2)
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuote.ts (1)
useTradeQuote(14-29)apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts (1)
useTradeQuotePolling(23-137)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Cypress
- GitHub Check: Setup
🔇 Additional comments (55)
libs/common-utils/package.json (1)
3-3: Patch version bump is reasonable—double-check downstream alignment.The
versionfield is now1.17.1. Please verify:
- CHANGELOG entry exists for 1.17.1 and matches this fix.
- Any workspace root
package-lock.json/ yarn lockfile is updated.- Dependent internal packages reference
^1.17.1(or compatible) where needed.This prevents publish/CI mismatches.
apps/cow-fi/package.json (1)
3-3: Version bump LGTM – verify ancillary artifactsThe increment to
1.24.0is consistent with the monorepo manifest.
Please double-check that:
CHANGELOG.mdforapps/cow-fiincludes the new entry.- Any lockfile (
package-lock.json/pnpm-lock.yaml/yarn.lock) has been regenerated.libs/types/package.json (1)
3-3: Bump to 1.8.0 acknowledgedNo issues spotted with the metadata. Ensure downstream packages that pin
@cowprotocol/typesare updated if they require the new bridging types.libs/tokens/package.json (1)
3-3: Tokens package at 1.22.0Looks correct. Make sure any generated token docs (if applicable) are rebuilt so published artifacts reference the new version.
libs/common-hooks/package.json (1)
3-3: Patch bump looks good.Nothing else changed in this manifest; changelog already reflects the bug-fix.
apps/explorer/package.json (1)
3-3: Explorer version bumped correctly.Just make sure the deploy pipeline tags and Docker images follow the same
2.48.2tag to avoid drift.libs/balances-and-allowances/package.json (1)
3-3: Minor version bump acknowledged.Remember to update any peer-dependency ranges (e.g.
@cowprotocol/multicall) if they rely on the new feature set.package.json (2)
341-341: Trivial JSON tail change.Looks like only a formatting newline; no action required.
79-79: SDK RC upgrade – verify breaking-change surface across modules
6.0.0-RC.70is still a pre-release and is imported directly in multiple places—ensure no API or type changes slip through:• libs/types/src/common.ts
• libs/balances-and-allowances (updaters/hooks/state)
• libs/widget-lib (flexibleConfig.ts, types.ts)
• libs/ui/src/pure/NetworkLogo/index.tsx
• libs/wallet (api/types.ts, web3-react utils, updater, connection)
• libs/tokens/src/types.tsPlease run a full type‐check (
tsc --noEmit) and smoke-test these modules against v6.0.0-RC.70, and review the RC changelog for any breaking changes before merging.libs/hook-dapp-lib/CHANGELOG.md (1)
3-9: Changelog entry present & well-formatted.No typos, date is ISO-8601, links resolve.
libs/core/CHANGELOG.md (1)
3-9: Changelog entry looks correct.Version/date format, semantic version bump, and issue/commit references are all in order. No further action needed.
libs/common-hooks/CHANGELOG.md (1)
3-9: Changelog entry LGTM.Patch bump, scope tag, and linked issue/commit are consistent with conventions. 👍
libs/multicall/package.json (1)
3-3: Confirm dependency alignment after version bump.
"version": "1.2.0"is fine, but ensure any sibling packages that depend on@cowprotocol/multicallhave their version ranges updated (if they pin to^1.1.x).
A quick grep in the repo for"@cowprotocol/multicall"will catch mismatches.libs/wallet/package.json (1)
3-3: Check peer-/dev-dependency ranges for the wallet bump.Bumping to
1.13.0is OK; just verify no other packages are still pegged to<1.13.0which could cause resolution conflicts in workspaces.libs/common-const/package.json (1)
3-3: Version bump acknowledged.No immediate concerns. Ensure changelog entry and release workflow include this
1.21.0tag.apps/cowswap-frontend/package.json (1)
3-3: Version bump looks fine – double-check ancillary release artifactsThe new
1.111.0version aligns with the manifest summary. Please verify:
- A matching entry exists in
apps/cowswap-frontend/CHANGELOG.md..release-please-manifest.jsonreflects the same bump.- No other workspace/project references still pin
1.110.x.If all three are in sync, nothing else to do.
apps/explorer/CHANGELOG.md (1)
3-9: Changelog entry LGTM• Correct semantic version increment (
2.48.2)
• Links & commit hashes are well-formed
• Categorisation under “Bug Fixes” is consistent with repo standardsNo further action required.
libs/hook-dapp-lib/package.json (1)
3-3: Ensure downstream libraries consume1.8.0The bump to
1.8.0is clean. Run a quick search for@cowprotocol/[email protected]in the monorepo to avoid stale lockfile or peer-dep references.libs/wallet/CHANGELOG.md (1)
3-9: LGTM! Well-formatted changelog entry.The new version entry follows proper semantic versioning and changelog conventions. The feature description is clear and includes appropriate issue/commit references.
libs/types/CHANGELOG.md (1)
3-9: LGTM! Properly formatted changelog entry.The version entry follows semantic versioning conventions and includes clear feature description with appropriate references.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.test.tsx (1)
97-97: LGTM! Test updates correctly reflect hook signature changes.The addition of explicit parameters
(false, true)to theuseTradeQuotePollinghook calls properly aligns with the updated hook signature that now requires theisQuoteUpdatePossibleparameter.Also applies to: 117-117
libs/common-const/CHANGELOG.md (1)
3-9: LGTM! Consistent changelog entry across coordinated changes.The version entry properly documents the eip155 chain names feature implementation and maintains consistency with related changes in other libraries.
libs/common-utils/CHANGELOG.md (1)
3-9: LGTM! Correct semantic versioning for bug fix.The patch version increment and changelog format are appropriate for a bug fix. The entry includes clear description and proper issue/commit references.
libs/balances-and-allowances/CHANGELOG.md (1)
3-14: Changelog entry LGTMVersion bump, feature & bug-fix bullets follow the existing formatting conventions.
No issues spotted.libs/ui/CHANGELOG.md (1)
3-12: Changelog entry LGTMConsistent formatting and links; no issues detected.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuoteManager.ts (1)
27-27: LGTM: Clean formatting improvementThe consolidation of the function signature into a single line improves readability without affecting functionality.
apps/cowswap-frontend/src/modules/tradeQuote/utils/quoteDeadline.ts (2)
2-2: LGTM: Proper import additionThe
PriceQualityimport is correctly added to support the new conditional logic.
17-18: LGTM: Logical enhancement for FAST price qualityThe addition of the
PriceQuality.FASTcondition to skip expiration checks is a sensible optimization that recognizes different expiration semantics for fast quotes.libs/wallet/src/web3-react/utils/switchChain.ts (3)
2-11: LGTM: Clean import organizationThe addition of specific chain object imports is well-organized and sets up the foundation for using dynamic RPC URLs.
27-34: LGTM: Improved maintainability with dynamic RPC URLsReplacing hardcoded RPC URLs with dynamic values from chain objects improves maintainability and ensures consistency across the codebase.
53-53: LGTM: Alignment with eip155Label standardThe switch from
info.labeltoinfo.eip155Labelaligns with the broader codebase update to use EIP-155 chain naming standards.apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidations.ts (1)
1-14: LGTM: Clean and well-structured hook implementationThe hook is properly implemented with:
- Correct use of jotai for state management
- Appropriate debouncing to prevent excessive re-renders
- Clear return type annotation
- Reasonable 200ms debounce delay
This follows React best practices and integrates well with the broader trade form validation system.
apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetUpdaters.tsx (3)
9-9: LGTM: Proper hook importThe import for
useIsQuoteUpdatePossibleis correctly added to support the new quote update logic.
35-35: LGTM: Clean hook integrationThe hook is properly called at the component level to determine quote update feasibility.
49-52: LGTM: Improved component control flowThe refactoring to always render
TradeQuoteUpdaterwhile controlling its behavior through theisQuoteUpdatePossibleprop is a good architectural improvement. The boolean logic correctly combines the validation state with the polling disable flag.apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/TradeWidgetForm.tsx (3)
38-38: Import looks good.The import of
useIsQuoteUpdatePossibleis correctly placed and follows the established module structure.
115-115: Hook usage is correct.The hook is called at the top level as expected for React hooks, and the variable name is descriptive.
205-205: Conditional rendering logic is well-implemented.The addition of
isQuoteUpdatePossibleto the existing conditions (!isPriceStatic && !showDropdown) ensures theQuotePollingProgresscomponent only renders when quote updates are actually possible, improving UX by preventing misleading progress indicators.apps/cowswap-frontend/src/modules/trade/hooks/useIsQuoteUpdatePossible.ts (2)
3-10: Well-defined blocking states.The
NO_UPDATE_STATESarray covers the appropriate scenarios where quote updates should be blocked:
CurrencyNotSupportedandNetworkNotSupported- Invalid configurationsBrowserOffline- Network unavailableCurrencyNotSetandInputAmountNotSet- Missing required inputsWrapUnwrapFlow- Different flow that doesn't need quote pollingThe selection is logical and comprehensive.
12-16: Hook implementation is correct and efficient.The hook correctly:
- Uses the debounced validations from
useGetTradeFormValidations- Defaults to
truewhen validations are null (allowing updates when validation state is unknown)- Uses
Array.includes()withsome()for efficient checking- Has a clear return type and follows React hook conventions
The logic is sound and the implementation is concise.
apps/cowswap-frontend/src/modules/tradeFormValidation/hooks/useGetTradeFormValidation.ts (2)
1-1: Import change is appropriate.The import of
useGetTradeFormValidationsreplaces the previous direct atom usage, which is consistent with the refactoring to centralize validation logic.
6-8: Refactored implementation maintains backward compatibility.The hook now delegates to
useGetTradeFormValidationsand returns the first validation from the array, which:
- Maintains the same API for existing consumers
- Removes code duplication by leveraging the new centralized hook
- Simplifies the implementation while preserving functionality
The logic is correct and the refactoring improves maintainability.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/usePollQuoteCallback.ts (3)
20-20: Parameter addition is well-documented.The new
isQuoteUpdatePossibleparameter is appropriately typed as boolean and positioned logically after the existingisConfirmOpenparameter.
41-41: Early exit condition is correctly implemented.Adding
!isQuoteUpdatePossibleto the early exit condition ensures that quote polling is prevented when updates aren't possible, which:
- Improves performance by avoiding unnecessary work
- Maintains consistency with the UI state (when QuotePollingProgress is hidden)
- Follows the same pattern as other validation checks in the condition
The placement as the first condition is logical since it's a high-level gate.
79-79: Dependency array correctly updated.The addition of
isQuoteUpdatePossibleto the dependency array ensures the callback is recreated when the quote update possibility changes, which is necessary for proper hook behavior.libs/common-const/src/chainInfo.ts (3)
25-25: Interface extension is well-designed.The addition of
eip155Labelas a readonly string property is consistent with the existing interface design and follows the naming convention used for other label properties.
39-48: Type definition properly updated.The Pick type correctly includes the new
eip155Labelproperty, maintaining type safety and ensuring the mapping function returns the expected interface shape.
60-60: Implementation correctly maps the new property.The mapping of
eip155Label: chainInfo.eip155Labelfollows the established pattern and correctly propagates the property from the input to the output.apps/cowswap-frontend/src/modules/tradeQuote/updaters/TradeQuoteUpdater/index.tsx (1)
7-15: LGTM! Clean integration ofisQuoteUpdatePossibleprop.The changes properly extend the component interface and pass the new prop to the polling hook as expected.
.release-please-manifest.json (1)
1-29: Version bumps aligned with feature rollout.The manifest updates track version increments for multiple packages, reflecting the changes described in the AI summary including the new
eip155Labelproperty and quote polling enhancements.apps/cowswap-frontend/src/modules/tradeFormValidation/services/validateTradeForm.ts (1)
12-135: Good refactor to collect all validation errors.The change from returning a single validation to collecting all applicable validations provides better user feedback by showing all issues at once rather than one at a time.
apps/cowswap-frontend/src/modules/tradeQuote/hooks/useTradeQuotePolling.ts (4)
2-2: Consider the performance impact of switching fromuseEffecttouseLayoutEffect.All effects in this hook have been changed to
useLayoutEffect. SinceuseLayoutEffectruns synchronously before browser paint, this could potentially impact performance, especially with multiple intervals running. Was this change necessary for all effects, or only specific ones that need synchronous execution?Also applies to: 50-50, 64-64, 79-79, 88-88, 99-99, 120-120
117-134: Good addition of quote expiration monitoring.The new effect that checks for quote expiration every 2 seconds and triggers immediate updates is a valuable enhancement for keeping quotes fresh.
7-8: Clean time constant definition withms.macro.Using
ms.macrofor theQUOTE_VALIDATION_INTERVALconstant improves readability and maintainability.Also applies to: 21-21
23-23: Proper integration ofisQuoteUpdatePossibleparameter.The new parameter is correctly added to the function signature and properly passed to the
usePollQuoteCallbackhook.Also applies to: 43-43
| }, | ||
| id: chainId, | ||
| label: info.label, | ||
| eip155Label: info.eip155Label, |
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.
Provide a fallback for eip155Label to stay backward-compatible
Older network objects shipped before this field was introduced may not have eip155Label yet.
Returning undefined is harmless for consumers that treat it as optional, but several recent callers (e.g. wallet switchChain) pass it directly to the provider where an empty string can violate EIP-3085.
- eip155Label: info.eip155Label,
+ // Fallback keeps legacy networks working until all entries are migrated.
+ eip155Label: info.eip155Label ?? info.label,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| eip155Label: info.eip155Label, | |
| // Fallback keeps legacy networks working until all entries are migrated. | |
| eip155Label: info.eip155Label ?? info.label, |
🤖 Prompt for AI Agents
In apps/cowswap-frontend/src/modules/tokensList/utils/mapChainInfo.ts at line
24, the eip155Label property may be undefined for older network objects, which
can cause issues when passed directly to providers expecting a non-empty string.
To fix this, provide a fallback value such as an empty string or a default label
when info.eip155Label is undefined, ensuring backward compatibility and
preventing violations of EIP-3085.
| if (isNativeIn) { | ||
| return TradeFormValidation.SellNativeToken | ||
| validations.push(TradeFormValidation.SellNativeToken) | ||
| } | ||
|
|
||
| if (approvalRequired) { | ||
| if (isBundlingSupported) { | ||
| return TradeFormValidation.ApproveAndSwap | ||
| validations.push(TradeFormValidation.ApproveAndSwap) | ||
| } | ||
| return TradeFormValidation.ApproveRequired | ||
| validations.push(TradeFormValidation.ApproveRequired) | ||
| } | ||
|
|
||
| if (isNativeIn) { | ||
| return TradeFormValidation.SellNativeToken | ||
| validations.push(TradeFormValidation.SellNativeToken) | ||
| } |
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.
Remove duplicate SellNativeToken validation.
The SellNativeToken validation is added twice - once at lines 119-122 and again at lines 130-132. This will result in duplicate validation messages.
Remove the duplicate check:
- if (isNativeIn) {
- validations.push(TradeFormValidation.SellNativeToken)
- }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (isNativeIn) { | |
| return TradeFormValidation.SellNativeToken | |
| validations.push(TradeFormValidation.SellNativeToken) | |
| } | |
| if (approvalRequired) { | |
| if (isBundlingSupported) { | |
| return TradeFormValidation.ApproveAndSwap | |
| validations.push(TradeFormValidation.ApproveAndSwap) | |
| } | |
| return TradeFormValidation.ApproveRequired | |
| validations.push(TradeFormValidation.ApproveRequired) | |
| } | |
| if (isNativeIn) { | |
| return TradeFormValidation.SellNativeToken | |
| validations.push(TradeFormValidation.SellNativeToken) | |
| } | |
| if (isNativeIn) { | |
| validations.push(TradeFormValidation.SellNativeToken) | |
| } | |
| if (approvalRequired) { | |
| if (isBundlingSupported) { | |
| validations.push(TradeFormValidation.ApproveAndSwap) | |
| } | |
| validations.push(TradeFormValidation.ApproveRequired) | |
| } |
🤖 Prompt for AI Agents
In
apps/cowswap-frontend/src/modules/tradeFormValidation/services/validateTradeForm.ts
between lines 119 and 132, the validation TradeFormValidation.SellNativeToken is
pushed twice to the validations array. Remove the second occurrence at lines
130-132 to avoid duplicate validation messages.
Summary by CodeRabbit
New Features
eip155chain names in wallet integration.Bug Fixes
Chores