Skip to content

fix(gateway): do not convert unixfs/raw into dag-* unless explicit - #9565

Closed
hacdias wants to merge 2 commits into
masterfrom
json-cbor-changes
Closed

fix(gateway): do not convert unixfs/raw into dag-* unless explicit#9565
hacdias wants to merge 2 commits into
masterfrom
json-cbor-changes

Conversation

@hacdias

@hacdias hacdias commented Jan 19, 2023

Copy link
Copy Markdown
Member

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

hacdias commented Jan 19, 2023

Copy link
Copy Markdown
Member Author

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