Skip to content

Escrow management#518

Merged
andreip136 merged 28 commits into
mainfrom
feat/escrow-management
Jun 24, 2026
Merged

Escrow management#518
andreip136 merged 28 commits into
mainfrom
feat/escrow-management

Conversation

@andreip136

@andreip136 andreip136 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #532 , #533 .

Changes proposed in this PR:

  • New section for managing escrow (deposit/ withdraw/ manage authorizations)
  • Fix duration formatter not working properly for durations over 24h
  • Removed old unused withdraw component
  • Removed escrow withdraw section from node info balance
  • Added ETH address in node info

Summary by CodeRabbit

Summary by CodeRabbit

Release Notes

  • New Features
    • Added an “Manage escrow” option in the profile menu, opening a new escrow dashboard with token panels, authorization create/edit/revoke modals, and active locks visualization.
  • Improvements
    • Standardized token amount rendering across payment and escrow screens.
    • Refreshed the payment authorization form experience and validation for consistent submit/back actions.
    • Simplified node balance views to focus on node funds.
  • Removals
    • Removed the standalone withdraw page and related withdraw UI.

@andreip136 andreip136 self-assigned this Jun 15, 2026
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodes-dashboard Ready Ready Preview, Comment Jun 23, 2026 2:12pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f526dcd-abef-40a3-9def-d38c63231a75

📥 Commits

Reviewing files that changed from the base of the PR and between 56fb0f2 and a357bf9.

📒 Files selected for processing (1)
  • src/lib/use-escrow-data.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/use-escrow-data.ts

📝 Walkthrough

Walkthrough

Adds a new escrow management dashboard at /profile/escrow with token balance display, deposit/withdraw forms, and authorization management. Introduces shared AuthorizationForm and TokenAmount components reused in the run-job payment flow. Extends OceanProvider with escrow query methods and adds a getEscrowEvents node service function. Removes standalone withdraw page and strips escrow logic from the node balance component.

Changes

Escrow Dashboard and Payment Flow Consolidation

Layer / File(s) Summary
Escrow domain types and duration formatting
src/types/payment.ts, src/utils/formatters.ts
Adds EscrowLock and EscrowEvent exported types; introduces an internal formatHMS helper replacing dayjs.duration formatting in formatDuration.
Escrow provider and node event APIs
src/lib/ocean-provider.ts, src/services/nodeService.ts
Adds getEscrowAddress(), getUserFundsDetailed(), and getLocks() to OceanProvider; adds getEscrowEvents() to nodeService with URL query parameter construction and typed EscrowEvent[] response.
Escrow data aggregation hook
src/lib/use-escrow-data.ts, src/lib/use-deposit-tokens.ts, src/lib/use-withdraw-tokens.ts
Introduces useEscrowData with address deduplication, token and spender state loading, Auth-event spender discovery, and Promise.allSettled per-spender data fetching; aligns deposit/withdraw handler return types to Promise<void>.
Shared AuthorizationForm and TokenAmount components
src/components/escrow/authorization-form.tsx, src/components/escrow/authorization-form.module.css, src/components/token-amount/token-amount.tsx, src/components/token-amount/token-amount.module.css
Adds reusable AuthorizationForm with Formik/Yup validation and configurable action renderers; adds TokenAmount with size variant and error prop, backed by dedicated CSS modules.
Create, edit, and revoke authorization modals
src/components/escrow/create-authorization-modal.tsx, src/components/escrow/edit-authorization-modal.tsx, src/components/escrow/revoke-authorization-modal.tsx
Adds CreateAuthorizationModal with node consumer address resolution, duplicate consumer detection, and lock parameter validation; adds EditAuthorizationModal pre-filling existing spender data into AuthorizationForm; adds RevokeAuthorizationModal with active-lock warning.
EscrowTokenPanel component and styling
src/components/escrow/escrow-token-panel.tsx, src/components/escrow/escrow-token-panel.module.css
Adds EscrowTokenPanel with AuthorizationCard sub-component (collapsible locks, edit modal), deposit/withdraw Formik forms wired to token hooks, and CreateAuthorizationModal integration; includes a 366-line CSS module for responsive grid, auth cards, locks table, progress bar, and empty states.
Escrow page composition, routing, and navigation
src/components/escrow/escrow-page.tsx, src/components/escrow/escrow-page.module.css, src/pages/profile/escrow.tsx, src/components/Navigation/profile-button.tsx, src/pages/withdraw.tsx
Adds EscrowPage with conditional loading/panel rendering, adds the /profile/escrow page wrapper and a "Manage escrow" nav menu item; removes the standalone withdraw page route.
Run-job payment screens migrated to shared components
src/components/run-job/payment-authorize.tsx, src/components/run-job/payment-summary.tsx, src/components/run-job/payment-summary.module.css
Replaces local Formik form in payment-authorize with AuthorizationForm; migrates all five balance rows in payment-summary from inline formatted spans to TokenAmount; adds CSS layout alignment fixes.
Authorization hook peer-aware success messaging
src/lib/use-authorize-tokens.ts
Extends AuthorizeTokensParams with optional peerId, adds authorizationSuccessMessage using formatWalletAddress, and updates both EOA and non-EOA success toasts to use it.
Node balance cleanup and node-info identifier display
src/components/node-details/balance.tsx, src/components/node-details/node-info.tsx, src/components/node-details/node-info.module.css
Removes escrow state and admin gating from Balance; updates NodeInfo to compute nodeId from node.id ?? node.nodeId, adds CopyButton rows for Peer ID and ETH Address, gates Balance rendering on isAdmin, and adds .copyRow CSS with ellipsis truncation.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(100, 149, 237, 0.5)
    Note over EscrowPage,OceanProvider: Page Load & Data Fetch
    EscrowPage->>useEscrowData: mount → load()
    useEscrowData->>OceanProvider: getSupportedTokens()
    OceanProvider-->>useEscrowData: token list
    useEscrowData->>OceanProvider: getUserFundsDetailed(token, user)
    OceanProvider-->>useEscrowData: available, locked balances
    useEscrowData->>nodeService: getEscrowEvents(Auth, payer)
    nodeService-->>useEscrowData: EscrowEvent[] (spender addresses)
    useEscrowData->>OceanProvider: getLocks(token, payer, spender)
    OceanProvider-->>useEscrowData: EscrowLock[]
    useEscrowData-->>EscrowPage: tokens, spenders, loading, reload
  end
  rect rgba(144, 238, 144, 0.5)
    Note over EscrowTokenPanel,OceanProvider: Create & Edit Authorization
    EscrowTokenPanel->>CreateAuthorizationModal: open(tokenAddress, existingConsumers)
    CreateAuthorizationModal->>nodeService: getNodes(nodeId)
    nodeService-->>CreateAuthorizationModal: node + consumerAddress
    CreateAuthorizationModal->>useAuthorizeTokens: handleAuthorize(tokenAddress, peerId, spender, lockParams)
    useAuthorizeTokens->>OceanProvider: authorize on-chain
    OceanProvider-->>useAuthorizeTokens: success
    useAuthorizeTokens-->>CreateAuthorizationModal: toast(authorizationSuccessMessage)
    CreateAuthorizationModal-->>EscrowTokenPanel: onSuccess() → reload()
  end
  rect rgba(255, 182, 193, 0.5)
    Note over EscrowTokenPanel,OceanProvider: Deposit & Withdraw
    EscrowTokenPanel->>useDepositTokens: handleDeposit(amount)
    useDepositTokens->>OceanProvider: approve + deposit
    OceanProvider-->>useDepositTokens: success
    useDepositTokens-->>EscrowTokenPanel: onSuccess() → reload()
    EscrowTokenPanel->>useWithdrawTokens: handleWithdraw(amount)
    useWithdrawTokens->>OceanProvider: withdraw
    OceanProvider-->>useWithdrawTokens: success
    useWithdrawTokens-->>EscrowTokenPanel: onSuccess() → reload()
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • mihaisc
  • giurgiur99
  • dnsi0
  • ndrpp

Poem

🐇 A wallet icon hops into the nav,
Escrow panels bloom with balance and grace,
Authorization forms stand steadfast and brave,
TokenAmount components take up their place.
Locks dance and deposit, withdraw with care—
New escrow dashboard blooms everywhere! 🏦

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "Escrow management" directly relates to the main objective of implementing escrow management functionality for the Ocean Protocol dashboard.
Linked Issues check ✅ Passed The PR implements all acceptance criteria from issue #532: a new Escrow section in the dashboard, displays user escrow balance, lists authorizations, and lists active locks.
Out of Scope Changes check ✅ Passed Minor changes to unrelated components (Balance, NodeInfo, PaymentSummary) and removal of outdated Withdraw component fall within scope as supporting improvements and cleanup mentioned in PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/escrow-management

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/run-job/payment-summary.tsx (1)

31-31: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix allowance insufficiency calculation when authorization data is missing.

At Line 31, Number(authorizations?.maxLockedAmount) ?? 0 can produce NaN, and ?? 0 won’t apply to NaN. That makes the check false and hides the “Insufficient allowance” state at Lines 66-70 when authorizations are absent/invalid.

Suggested fix
-  const insufficientAutorized = (Number(authorizations?.maxLockedAmount) ?? 0) < totalCost;
+  const maxLockedAmount = Number(authorizations?.maxLockedAmount ?? 0);
+  const insufficientAutorized = !Number.isFinite(maxLockedAmount) || maxLockedAmount < totalCost;

Also applies to: 64-70

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/run-job/payment-summary.tsx` at line 31, The
`insufficientAutorized` variable calculation on line 31 has a logic error where
`Number(authorizations?.maxLockedAmount) ?? 0` can produce NaN when
authorization data is invalid, and the nullish coalescing operator does not
catch NaN values, causing the comparison to fail silently. Fix this by
restructuring the expression to ensure a valid number is always produced, such
as using `Number(authorizations?.maxLockedAmount || 0)` which handles
undefined/invalid values before conversion, allowing the insufficient allowance
message at lines 66-70 to display correctly when authorization data is missing
or invalid.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/components/run-job/payment-summary.tsx`:
- Line 31: The `insufficientAutorized` variable calculation on line 31 has a
logic error where `Number(authorizations?.maxLockedAmount) ?? 0` can produce NaN
when authorization data is invalid, and the nullish coalescing operator does not
catch NaN values, causing the comparison to fail silently. Fix this by
restructuring the expression to ensure a valid number is always produced, such
as using `Number(authorizations?.maxLockedAmount || 0)` which handles
undefined/invalid values before conversion, allowing the insufficient allowance
message at lines 66-70 to display correctly when authorization data is missing
or invalid.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ceed499-62b5-450b-8c78-d85da05ba33b

📥 Commits

Reviewing files that changed from the base of the PR and between d4145be and ed0947f.

📒 Files selected for processing (5)
  • src/components/escrow/escrow-token-panel.tsx
  • src/components/run-job/payment-summary.module.css
  • src/components/run-job/payment-summary.tsx
  • src/lib/use-escrow-data.ts
  • src/services/nodeService.ts
✅ Files skipped from review due to trivial changes (1)
  • src/components/run-job/payment-summary.module.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/use-escrow-data.ts
  • src/components/escrow/escrow-token-panel.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/use-ocean-account.tsx`:
- Around line 176-179: The `ocean` instance in use-ocean-account.tsx is
initialized with a read-only JsonRpcProvider, but the methods
`authorizeTokensEoa`, `depositTokensEoa`, and `withdrawTokensEoa` all internally
call `this.provider.getSigner()` which fails on read-only providers. Fix this by
either: (1) modifying the ocean provider initialization to use the wallet's
BrowserProvider (the `provider` variable defined earlier in the hook) for write
operations while keeping the read-only provider for read-only calls, or (2)
refactor the three escrow write methods to use `sendTransaction` from the wallet
context with encoded contract calls instead of relying on the ocean instance's
signer-dependent methods.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a0f11014-02b2-4e50-a7c9-60d88dd57c5b

📥 Commits

Reviewing files that changed from the base of the PR and between ed0947f and 03ae23f.

📒 Files selected for processing (1)
  • src/lib/use-ocean-account.tsx

Comment thread src/lib/use-ocean-account.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/node-details/node-info.tsx (1)

82-84: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard condition checks node?.id but operation uses nodeId.

The guard checks !node?.id, but the subsequent operations use nodeId which is derived from node.id ?? node.nodeId. If a node has only nodeId (not id), this function returns early even though nodeId holds a valid value.

The same pattern appears in handlePushConfig (line 107) and handleDownloadLogs (line 150).

🐛 Proposed fix
   async function handleFetchConfig() {
     if (!account.isConnected) {
       login();
       return;
     }
-    if (!ocean || !node?.id) {
+    if (!ocean || !nodeId) {
       return;
     }

Apply the same fix to handlePushConfig and handleDownloadLogs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/node-details/node-info.tsx` around lines 82 - 84, The guard
condition checks `!node?.id` but the function uses `nodeId` which is derived
from `node.id ?? node.nodeId`. This causes the function to return early even
when `nodeId` contains a valid value (when node only has nodeId but not id).
Update the guard condition to check `!nodeId` instead of `!node?.id` to properly
validate the value actually being used. Apply this same fix pattern to both the
`handlePushConfig` method and the `handleDownloadLogs` method where the
identical issue occurs.
src/lib/use-authorize-tokens.ts (1)

50-55: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prevent stuck loading when the Ocean client is unavailable.

At Line 54, the EOA path returns early after setIsAuthorizing(true) (Line 53), leaving isAuthorizing stuck true. This can lock authorization UI indefinitely.

Proposed fix
     async ({ tokenAddress, peerId, spender, maxLockedAmount, maxLockSeconds, maxLockCount }: AuthorizeTokensParams) => {
       if (user?.type === 'eoa') {
         try {
-          setIsAuthorizing(true);
-          if (!ocean) return;
+          if (!ocean) {
+            setError('Ocean client not initialized');
+            toast.error('Authorization failed');
+            return;
+          }
+          setIsAuthorizing(true);
           const tx = await ocean.authorizeTokensEoa({
             tokenAddress,
             spender,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/use-authorize-tokens.ts` around lines 50 - 55, The early return
statement in the EOA authorization path (when checking if !ocean) occurs after
setIsAuthorizing(true) has been called, which leaves the isAuthorizing state
stuck in true state indefinitely. Before returning early when the ocean client
is unavailable, reset the isAuthorizing state to false by calling
setIsAuthorizing(false) to ensure the loading state does not persist and lock
the authorization UI.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/escrow/create-authorization-modal.tsx`:
- Around line 58-75: The handleAuthorize function call in the onSubmit callback
is async but not being awaited, which allows Formik to clear the isSubmitting
state before the authorization transaction completes, potentially reopening the
submit path during latency. Add the await keyword before the handleAuthorize
call to ensure Formik keeps isSubmitting true until the authorization lifecycle
completes, preventing duplicate submissions during transaction processing.
- Around line 84-85: In the axios GET request where the node lookup is
performed, replace the manually constructed URL string with proper parameter
encoding. Instead of interpolating nodeId directly into the URL string in the
axios.get call for the nodes endpoint, use Axios's params configuration option
to pass all query parameters (page, size, and nodeId) as an object in the second
argument. This ensures proper URL encoding and prevents malformed requests.

---

Outside diff comments:
In `@src/components/node-details/node-info.tsx`:
- Around line 82-84: The guard condition checks `!node?.id` but the function
uses `nodeId` which is derived from `node.id ?? node.nodeId`. This causes the
function to return early even when `nodeId` contains a valid value (when node
only has nodeId but not id). Update the guard condition to check `!nodeId`
instead of `!node?.id` to properly validate the value actually being used. Apply
this same fix pattern to both the `handlePushConfig` method and the
`handleDownloadLogs` method where the identical issue occurs.

In `@src/lib/use-authorize-tokens.ts`:
- Around line 50-55: The early return statement in the EOA authorization path
(when checking if !ocean) occurs after setIsAuthorizing(true) has been called,
which leaves the isAuthorizing state stuck in true state indefinitely. Before
returning early when the ocean client is unavailable, reset the isAuthorizing
state to false by calling setIsAuthorizing(false) to ensure the loading state
does not persist and lock the authorization UI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f26535d4-8344-4996-b37a-e828ba07da20

📥 Commits

Reviewing files that changed from the base of the PR and between 03ae23f and 9b52ff8.

📒 Files selected for processing (5)
  • src/components/escrow/create-authorization-modal.tsx
  • src/components/node-details/node-info.module.css
  • src/components/node-details/node-info.tsx
  • src/components/run-job/payment-authorize.tsx
  • src/lib/use-authorize-tokens.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/run-job/payment-authorize.tsx

Comment thread src/components/escrow/create-authorization-modal.tsx
Comment thread src/components/escrow/create-authorization-modal.tsx Outdated
andreip136 and others added 3 commits June 19, 2026 13:12
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@andreip136 andreip136 mentioned this pull request Jun 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/lib/use-escrow-data.ts (1)

70-95: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep spender loading resilient to per-payee RPC failures.

Line 73 uses Promise.all(...) for all payees of a token. One failed getLocks rejects the entire token batch, dropping otherwise valid spender rows.

💡 Suggested patch
       const settled = await Promise.allSettled(
         tokenList.map(async (token) => {
           const allAuthorizations = await ocean.getAllAuthorizations(token.address, account.address!);
-          return Promise.all(
+          const perPayee = await Promise.allSettled(
             allAuthorizations.map(async (authorizations) => {
               const spender = authorizations.payee;
               const locks = await ocean.getLocks(token.address, account.address!, spender);
               return {
                 tokenSymbol: token.symbol,
                 tokenAddress: token.address,
                 spender,
                 authorizations,
                 locks,
               };
             })
           );
+          return perPayee
+            .filter((r): r is PromiseFulfilledResult<EscrowSpenderInfo> => r.status === 'fulfilled')
+            .map((r) => r.value);
         })
       );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/use-escrow-data.ts` around lines 70 - 95, The inner Promise.all call
that maps over allAuthorizations is causing the entire token batch to fail if
any single getLocks call fails for a payee. Replace the Promise.all with
Promise.allSettled for the inner mapping over allAuthorizations, then filter the
results to keep only the fulfilled items and extract their values. This ensures
that if one payee's getLocks fails, the other valid spender rows for that token
are still included in the results instead of the entire token batch being
dropped.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/escrow/revoke-authorization-modal.tsx`:
- Around line 58-63: The Button component in the revoke authorization modal has
a disabled prop that only checks hasActiveLocks, but it doesn't prevent
interaction while isAuthorizing is true. This allows users to trigger multiple
revoke transactions. Update the disabled prop to combine both conditions so the
button is disabled when either hasActiveLocks is true OR isAuthorizing is true,
ensuring the button remains disabled during the entire authorization process.

In `@src/lib/use-escrow-data.ts`:
- Around line 15-18: The current filtering logic uses the isRevokedAuthorization
function to remove rows at lines 95-96, but this suppresses revoked
authorizations that still have active locks, causing the Escrow locks list to be
incomplete. Modify the filter condition to not only check if an authorization is
revoked but also verify whether it still has active locks remaining; only remove
the row if it is revoked AND has no active locks, ensuring that any
authorization with ongoing locked amounts is retained in the list regardless of
its revocation status.

---

Duplicate comments:
In `@src/lib/use-escrow-data.ts`:
- Around line 70-95: The inner Promise.all call that maps over allAuthorizations
is causing the entire token batch to fail if any single getLocks call fails for
a payee. Replace the Promise.all with Promise.allSettled for the inner mapping
over allAuthorizations, then filter the results to keep only the fulfilled items
and extract their values. This ensures that if one payee's getLocks fails, the
other valid spender rows for that token are still included in the results
instead of the entire token batch being dropped.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d8ede9c-12a2-41c0-b956-e7a2b4875745

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe8035 and 56fb0f2.

📒 Files selected for processing (5)
  • src/components/escrow/authorization-form.module.css
  • src/components/escrow/escrow-token-panel.tsx
  • src/components/escrow/revoke-authorization-modal.tsx
  • src/lib/ocean-provider.ts
  • src/lib/use-escrow-data.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/escrow/escrow-token-panel.tsx
  • src/lib/ocean-provider.ts

Comment thread src/components/escrow/revoke-authorization-modal.tsx
Comment thread src/lib/use-escrow-data.ts
@andreip136 andreip136 merged commit 8a59887 into main Jun 24, 2026
4 checks passed
@andreip136 andreip136 linked an issue Jun 24, 2026 that may be closed by this pull request
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.

Edit / revoke authorizations New Escrow section

2 participants