Skip to content

fix(tap-agent): accept receipts newer than the last redemption - #1086

Open
Maikol wants to merge 2 commits into
main-dips-rebasedfrom
mde/fix-receipts-after-redemption
Open

fix(tap-agent): accept receipts newer than the last redemption#1086
Maikol wants to merge 2 commits into
main-dips-rebasedfrom
mde/fix-receipts-after-redemption

Conversation

@Maikol

@Maikol Maikol commented Aug 11, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for CI Build 32387715723

Warning

No base build found for commit 43bc886 on main-dips-rebased.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 74.216%

Details

  • Patch coverage: 67 of 67 lines across 2 files are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 16642
Covered Lines: 12351
Line Coverage: 74.22%
Coverage Strength: 102.41 hits per line

💛 - Coveralls

@Maikol
Maikol requested review from MoonBoi9001 and tmigone August 12, 2026 14:02
})?;
let receipt_timestamp_ns = receipt.signed_receipt().timestamp_ns();

if receipt_timestamp_ns <= last_redeemed_at_ns {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here we're comparing the receipt_timestamp_ns to last_redeemed_at_ns, which comes from the block timestamp of the redeem transaction. When tap-agent collects, it excludes any receipts newer than timestamp_buffer_secs. So I think there's a gap here where some receipts will be lost.

.await?;

Ok(!data.payments_escrow_transactions.is_empty())
let mut latest_redeemed_at_secs: Option<u64> = None;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With no first, orderBy or orderDirection, graph-node will return 100 rows ordered by id.

Adding first: 1 would break sender_account.rs. So this check could use it's own query:

query LatestRedeemTransactionQuery($payer: Bytes!, $receiver: Bytes!, $allocationId: Bytes!) {
  paymentsEscrowTransactions(
    first: 1
    orderBy: timestamp
    orderDirection: desc
    where: { type: "redeem", payer_: { id: $payer }, receiver_: { id: $receiver }, allocationId: $allocationId }
  ) { timestamp }
}

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.

2 participants