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(gateway): do not convert unixfs/raw into dag-* unless explicit #9565

Closed
wants to merge 2 commits into from

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Jan 19, 2023

Note:: I also made an alternative version of this PR that includes less changes overall to achieve the same result #9566.

In the spirit of https://github.com/protocol/bifrost-infra/issues/2290 and ipfs/specs#328 (review), this PR removes IPLD Logical Format conversion via ?format=json|cbor (and respective Accept headers). Now we need to explicitly indicate dag-json|dag-cbor. The table of the output type for input\request combos:

Input \ Requested DAG-JSON DAG-CBOR JSON CBOR
Raw DAG-JSON DAG-CBOR Ignore (serveUnixFs) Ignore (serveUnixFs)
UnixFS DAG-JSON DAG-CBOR Ignore (serveUnixFs) Ignore (serveUnixFs)
DAG-JSON DAG-JSON DAG-CBOR Ignore (serveUnixFs) Ignore (serveUnixFs)
DAG-CBOR DAG-JSON DAG-CBOR Ignore (serveUnixFs) Ignore (serveUnixFs)
JSON DAG-JSON DAG-CBOR JSON CBOR
CBOR DAG-JSON DAG-CBOR JSON CBOR

I'm not exactly confident that this is simpler than the implementation we had before, or if it is a good idea. I think we should keep being able to retrieve JSON and CBOR CIDs from the Gateway, as well as converting between both formats. Then, we cannot convert DAG-JSON and DAG-CBOR to JSON/CBOR because of the links that are not supported in regular JSON and CBOR.

The CI is failing on unrelated things that I did not change. It seems that there may be some NPM/Network errors.

@hacdias hacdias changed the title fix(gateway): only convert between dag-* variants fix(gateway): do not convert unixfs/raw into dag-* unless explicity Jan 19, 2023
@hacdias hacdias changed the title fix(gateway): do not convert unixfs/raw into dag-* unless explicity fix(gateway): do not convert unixfs/raw into dag-* unless explicit Jan 19, 2023
@hacdias
Copy link
Member Author

hacdias commented Jan 19, 2023

Superseded by #9566.

@hacdias hacdias closed this Jan 19, 2023
@hacdias hacdias deleted the json-cbor-changes branch January 19, 2023 13:51
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.

1 participant