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

support encoding/decoding SSB URIs semantically #28

Merged
merged 2 commits into from
Aug 19, 2021
Merged

support encoding/decoding SSB URIs semantically #28

merged 2 commits into from
Aug 19, 2021

Conversation

staltz
Copy link
Member

@staltz staltz commented Aug 16, 2021

@staltz staltz requested review from mixmix and arj03 August 16, 2021 12:33
@staltz staltz marked this pull request as draft August 16, 2021 12:33
Copy link
Member

@mixmix mixmix left a comment

Choose a reason for hiding this comment

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

The message /msg thing is my main question.

Oh, and had thought about modifying the decide to to something like decode(buf, { toURI: true}) do you can force classic things to be uris too.

I think your solution of moving sigil seems wise though

@@ -6,7 +6,7 @@ const { bfeNamedTypes, bfeTypes } = bfe
tape('00 feed type', function (t) {
const values = [
'@6CAxOI3f+LUOVrbAl0IemqiS7ATpQvr9Mdw9LC4+Uv0=.ed25519', // classic
'@6CAxOI3f+LUOVrbAl0IemqiS7ATpQvr9Mdw9LC4+Uv0=.bbfeed-v1', // bendy-butt
'ssb:feed/bendybutt-v1/6CAxOI3f-LUOVrbAl0IemqiS7ATpQvr9Mdw9LC4-Uv0=', // bendy-butt
Copy link
Member

Choose a reason for hiding this comment

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

This diff makes it really nice and clear what's happening!

test/01-msg.js Show resolved Hide resolved
package.json Outdated
@@ -16,7 +16,7 @@
},
"dependencies": {
"is-canonical-base64": "^1.1.1",
"ssb-bfe-spec": "^0.1.1",
"ssb-bfe-spec": "github:ssb-ngi-pointer/ssb-bfe-spec#support-ssb-uris",
Copy link
Member

Choose a reason for hiding this comment

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

This do

Copy link
Member

Choose a reason for hiding this comment

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

I think you can upgrade this to the module latest now

@staltz
Copy link
Member Author

staltz commented Aug 19, 2021

@mycognosist I think this is a PR you could review, and I can drop arj (assuming he has too much to work on, but obviously if arj has comments I gladly welcome them too).

@staltz staltz removed the request for review from arj03 August 19, 2021 12:18
@mixmix
Copy link
Member

mixmix commented Aug 19, 2021

@staltz this looks good to me, just needs module installing I think.

@staltz
Copy link
Member Author

staltz commented Aug 19, 2021

Thanks @mixmix . I won't merge this PR before updating ssb-bfe-spec to an npm version, and before marking it non-draft. Just wanted more feedback (from more people) on the code, so that once ssb-bfe-spec is ready, we are ready to merge.

Copy link
Member

@mycognosist mycognosist left a comment

Choose a reason for hiding this comment

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

I can't spot anything obviously incorrect or out of place. Should be golden 👍🏻

@staltz staltz marked this pull request as ready for review August 19, 2021 13:34
@staltz
Copy link
Member Author

staltz commented Aug 19, 2021

Due to the tests being fundamentally changed (even if just a little), this will have be a new breaking change version.

@staltz staltz merged commit 93c73e5 into master Aug 19, 2021
@staltz staltz deleted the ssb-uri branch August 19, 2021 13:35
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