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: walking dag-cbor paths #39

Merged
merged 7 commits into from
Apr 8, 2024
Merged

fix: walking dag-cbor paths #39

merged 7 commits into from
Apr 8, 2024

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Mar 30, 2024

Title

Description

fixes #38

Notes & open questions

Also fixes an issue where we would throw "error walking path" for unixfs CIDs even if we had no error and the path was invalid.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@SgtPooki SgtPooki requested a review from a team as a code owner March 30, 2024 03:46
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

@@ -294,6 +324,9 @@ export class VerifiedFetch {
if (options?.signal?.aborted === true) {
throw new AbortError('signal aborted by user')
}
if (['ERR_NO_PROP', 'NO_TERMINAL_ELEMENT'].includes(err.code)) {
return notFoundResponse(resource.toString())
Copy link
Member Author

Choose a reason for hiding this comment

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

404 on bad paths for unixfs now too

@SgtPooki
Copy link
Member Author

this PR is passing on local run of ipfs/helia-http-gateway#67:

=== RUN   TestPathing/GET_DAG-CBOR_traverses_multiple_links/Status_code
--- PASS: TestPathing/GET_DAG-CBOR_traverses_multiple_links/Status_code (0.00s)
=== NAME  TestPathing/GET_DAG-CBOR_traverses_multiple_links
=== RUN   TestPathing/GET_DAG-CBOR_traverses_multiple_links/Body
--- PASS: TestPathing/GET_DAG-CBOR_traverses_multiple_links/Body (0.00s)
=== NAME  TestPathing/GET_DAG-CBOR_traverses_multiple_links
--- PASS: TestPathing/GET_DAG-CBOR_traverses_multiple_links (0.03s)
=== NAME  TestPathing
=== RUN   TestPathing/GET_DAG-CBOR_returns_404_on_non-existing_link

=== RUN   TestPathing/GET_DAG-CBOR_returns_404_on_non-existing_link/Status_code
--- PASS: TestPathing/GET_DAG-CBOR_returns_404_on_non-existing_link/Status_code (0.00s)
=== NAME  TestPathing/GET_DAG-CBOR_returns_404_on_non-existing_link
--- PASS: TestPathing/GET_DAG-CBOR_returns_404_on_non-existing_link (0.00s)

Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

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

LGTM, comments inline.

SgtPooki and others added 2 commits April 8, 2024 09:16
Co-authored-by: Alex Potsides <alex@achingbrain.net>
Base automatically changed from fix/raw-to-dag-json to main April 8, 2024 16:55
@SgtPooki SgtPooki merged commit 99668ce into main Apr 8, 2024
17 checks passed
@SgtPooki SgtPooki deleted the fix/dag-cbor-path-walking branch April 8, 2024 18:26
github-actions bot pushed a commit that referenced this pull request Apr 8, 2024
Copy link

github-actions bot commented Apr 8, 2024

🎉 This PR is included in version 1.3.7 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Apr 8, 2024

🎉 This PR is included in version 1.15.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented May 9, 2024

🎉 This PR is included in version 1.0.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: gateway conformance non-existent path on dag-cbor
2 participants