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: Rename Protocol::WebRTC to Protocol::WebRTCDirect #78

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Mar 17, 2023

See multiformats/multiaddr#150 (comment) for context.

@melekes @thomaseizinger can you give this a review?

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

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

👍

@@ -202,7 +202,7 @@ impl<'a> Protocol<'a> {
}
"p2p-websocket-star" => Ok(Protocol::P2pWebSocketStar),
"p2p-webrtc-star" => Ok(Protocol::P2pWebRtcStar),
"webrtc" => Ok(Protocol::WebRTC),
"webrtc-direct" => Ok(Protocol::WebRTCDirect),
Copy link
Contributor

@melekes melekes Mar 18, 2023

Choose a reason for hiding this comment

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

I must say having both webrtc-direct and p2p-webrtc-direct is confusing, but I guess nothing we can do about it other than adding clear documentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could as well deprecate p2p-webrtc-direct. I am not aware of anyone using it. Though intuitively, that decision should happen on https://github.com/multiformats/multiaddr.

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Could we first release a version where we accept parsing as /webrtc-direct and not rename the variant, thus making this a non-breaking change?

I'd like to batch some breaking changes in rust-multiaddr together, e.g. #77 and #73 but those are not ready yet. Especially #73 needs a breaking change in libp2p-identity first which implies a round of breaking changes to libp2p.

@mxinden
Copy link
Member Author

mxinden commented Mar 20, 2023

Could we first release a version where we accept parsing as /webrtc-direct and not rename the variant, thus making this a non-breaking change?

On first thought this is a great idea. Though I am not sure there are no hidden surprises with this strategy. E.g. the guarantee of round-trip parsing (/webrtc-direct -> binary -> /webrtc-direct) no longer holds.

Breaking change:

  • Avoid long-term confusion, i.e. get it over with quickly
  • Needs a breaking change in libp2p

Non-breaking change:

  • Safes us and our users a lot of work
  • Might be a footgun
  • Could also default to /webrtc-direct from binary to text already now
  • Takes time to fully finish, thus less time between now and the introduction of browser-to-browser /webrtc

Thoughts @thomaseizinger?

@mxinden
Copy link
Member Author

mxinden commented Mar 21, 2023

Friendly ping @thomaseizinger. What are your thoughts here?

@thomaseizinger
Copy link
Contributor

Friendly ping @thomaseizinger. What are your thoughts here?

Didn't submit my comment 🤦‍♂️

@thomaseizinger
Copy link
Contributor

Could we first release a version where we accept parsing as /webrtc-direct and not rename the variant, thus making this a non-breaking change?

On first thought this is a great idea. Though I am not sure there are no hidden surprises with this strategy. E.g. the guarantee of round-trip parsing (/webrtc-direct -> binary -> /webrtc-direct) no longer holds.
Breaking change:

  • Avoid long-term confusion, i.e. get it over with quickly
  • Needs a breaking change in libp2p

Non-breaking change:

  • Safes us and our users a lot of work
  • Might be a footgun
  • Could also default to /webrtc-direct from binary to text already now
  • Takes time to fully finish, thus less time between now and the introduction of browser-to-browser /webrtc

Thoughts @thomaseizinger?

What we'd need to work out is how exactly we are going to introduce the other /webrtc protocol after this.

We definitely need to log a deprecation warning if we are now adding the 2nd representation.

Then in a breaking change, we can rename the variant and add the "new" /webrtc protocol.

How big is the footgun actually?

@thomaseizinger
Copy link
Contributor

How big is the footgun actually?

The only problem I can think of is that in the "breaking" change where we add the new (browser-to-browser) /webrtc protocol, users of multiaddr might not realise that the WebRTC protocol semantically changes. However, afaik the only user of this is us in libp2p-webrtc and we know to be careful here.

Ideally, semantic breaking changes are also compile-time breaking changes but I'd say with sufficient documentation, we can also deviate from that. I've pushed multiformats/rust-multihash#272 forward a lot so I'd love if the next breaking change can already include that (and thus be the last one in a while).

@thomaseizinger
Copy link
Contributor

If we move forward with this, it would have to be done as a patch-release from 0.17.0 because master already contains breaking changes.

@mxinden
Copy link
Member Author

mxinden commented Mar 22, 2023

Pull request for the non-breaking change: #84

@mxinden mxinden changed the title fix: Rename /webrtc to /webrtc-direct fix: Rename Protocol::WebRTC to `Protocol::WebRTCDirect Mar 23, 2023
@mxinden mxinden changed the title fix: Rename Protocol::WebRTC to `Protocol::WebRTCDirect fix: Rename Protocol::WebRTC to Protocol::WebRTCDirect Mar 23, 2023
@mxinden
Copy link
Member Author

mxinden commented Mar 23, 2023

With #84 released as v0.17.1, I updated this pull request, making the breaking change of renaming Protocol::WebRTC to Protocol::WebRTCDirect and removal of the deprecated /webrtc string representation.

@mxinden mxinden requested review from thomaseizinger and melekes and removed request for thomaseizinger and melekes March 23, 2023 09:32
@mxinden
Copy link
Member Author

mxinden commented Mar 23, 2023

I seem to only be able to request a review from one of the two of you.

@@ -1,9 +1,15 @@
# 0.18.0 [unreleased]
# 0.18.0 - unreleased

- Add `WebTransport` instance for `Multiaddr`. See [PR 70].
- Disable all features of `multihash`. See [PR 77].
- Mark `Protocol` as `#[non_exhaustive]`. See [PR 82].
Copy link
Contributor

Choose a reason for hiding this comment

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

This means we can then later add WebRTC in a non-breaking way right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Thomas Eizinger <[email protected]>
@DougAnderson444
Copy link

@mxinden when is this v0.18 planned for release so that we can use the new naming without patches?

@thomaseizinger
Copy link
Contributor

I'd first like to get a release of rust-multihash out: https://github.com/multiformats/rust-multihash/milestone/1

@thomaseizinger
Copy link
Contributor

I'd first like to get a release of rust-multihash out: multiformats/rust-multihash/milestone/1

I've created a milestone for rust-multiaddr too so we can easily keep track of this: https://github.com/multiformats/rust-multiaddr/milestone/3

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.

4 participants