Skip to content

Commit 03b692f

Browse files
MoonBoi9001claude
andcommitted
fix(dips): release allocation protection on agreement cancel
The pre-unallocate protection check treated both Accepted and CanceledByPayer as active, leaving allocations stranded on chain after dipper canceled the agreement. Narrow it to Accepted only so the agent closes the allocation as the cancel intends. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dc0154a commit 03b692f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • packages/indexer-common/src/indexer-management

packages/indexer-common/src/indexer-management/monitor.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ export class NetworkMonitor {
6363
if (!this.indexingPaymentsSubgraph) {
6464
return false
6565
}
66+
// Only `Accepted` blocks unallocation. Once the agreement is canceled
67+
// (by payer or by us), the on-chain agreement is already gone, so
68+
// protecting the allocation only strands it. The agent's separate
69+
// collectAgreementPayments loop handles any final collect on
70+
// `CanceledByPayer` agreements independently of allocation lifetime.
6671
const result = await this.indexingPaymentsSubgraph.checkedQuery(
6772
gql`
6873
query indexingAgreements($allocationId: Bytes!) {
6974
indexingAgreements(
70-
where: { allocationId: $allocationId, state_in: [Accepted, CanceledByPayer] }
75+
where: { allocationId: $allocationId, state: Accepted }
7176
first: 1
7277
) {
7378
id

0 commit comments

Comments
 (0)