Skip to content
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: reuse http/put and blob/accept receipts when available #1495

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

joaosa
Copy link
Contributor

@joaosa joaosa commented Jun 4, 2024

From @vasco-santos:

  1. if we already have a http/put receipt, we should not send one
  2. if we already receive in next a blob accept receipt, we should not await on the receipt generation

ran: nextTasks.put.task.cid,
result: { ok: {} },
})
}
const httpPutConcludeInvocation = createConcludeInvocation(
issuer,
// @ts-expect-error object of type unknown
audience,
httpPutReceipt
)
const ucanConclude = await httpPutConcludeInvocation.execute(conn)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am thinking this call should only be executed if we're missing a http/put receipt. however, I'm leaving it here as a "validation" the receipt we got makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

hmm, I think we don't need to conclude if we already have the receipt for a concluded task.

@vasco-santos is that right?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, we do not need. This can be from other uploaded content from other user. That is why we pass the seed key so that the issuer of invocation is content specific and not user/space specific

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed

@vasco-santos vasco-santos requested a review from Gozala June 4, 2024 17:33
ran: nextTasks.put.task.cid,
result: { ok: {} },
})
}
const httpPutConcludeInvocation = createConcludeInvocation(
issuer,
// @ts-expect-error object of type unknown
audience,
httpPutReceipt
)
const ucanConclude = await httpPutConcludeInvocation.execute(conn)
Copy link
Member

Choose a reason for hiding this comment

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

hmm, I think we don't need to conclude if we already have the receipt for a concluded task.

@vasco-santos is that right?

@vasco-santos vasco-santos merged commit 416802e into main Jun 5, 2024
3 checks passed
@vasco-santos vasco-santos deleted the fix/blob-add-receipts branch June 5, 2024 06:50
vasco-santos pushed a commit that referenced this pull request Jun 5, 2024
🤖 I have created a release *beep* *boop*
---


##
[16.1.1](upload-client-v16.1.0...upload-client-v16.1.1)
(2024-06-05)


### Fixes

* reuse http/put and blob/accept receipts when available
([#1495](#1495))
([416802e](416802e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants