-
Notifications
You must be signed in to change notification settings - Fork 446
MSC4487: Deprecate internal use of matrix.to navigation #4487
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,65 @@ | ||||||
| # MSC4487: Deprecate internal use of matrix.to navigation | ||||||
|
|
||||||
| The spec defines [matrix.to navigation](https://spec.matrix.org/v1.18/appendices/#matrixto-navigation) NOT as a service | ||||||
| on the web, but instead as a namespace URI piggybacking on the `https:` scheme before the `matrix:` scheme | ||||||
| was registered. | ||||||
| The intention is to have a clearly defined format to link to Matrix room aliases, room IDs, messages within rooms, and | ||||||
| user IDs. Clients are supposed to parse and handle this format internally to navigate between the aforementioned Matrix | ||||||
| entities similarly to links between pages on the web. | ||||||
|
|
||||||
| The <https://matrix.to> web service provided by the Foundation is available at and can resolve URLs in the matrix.to | ||||||
| shape as a kind of fallback functionality on the web. This is a very convenient workaround for any client not wanting to | ||||||
| spend the effort to special case internal navigation, and even when not showing a plain text matrix.to URL as a | ||||||
| clickable link many users understand the idea that they can copy this URL to their web browser to continue on. | ||||||
| Unfortunately this fallback remains a centralised crutch in an otherwise decentralised ecosystem when not resolved | ||||||
| inside of a client. | ||||||
|
|
||||||
| Matrix has introduced and registered the `matrix:` URI scheme as a parallel system with the major advantages of being | ||||||
| independent of the `https:` scheme, hence allowing deeper integration in URI handlers, while still remaining generalised | ||||||
| to fit the principle of free client choice in Matrix. It also simplifies parsing in clients significantly since special | ||||||
| casing `https://matrix.to` for internal routing is not a standard use case and often requires painful manual parsing. | ||||||
|
|
||||||
| ## Proposal | ||||||
|
|
||||||
| Sending matrix.to URLs over Matrix is deprecated. | ||||||
|
|
||||||
| Clients SHALL instead generate `matrix:` URIs when it is clear that: | ||||||
|
|
||||||
| - a reference to a Matrix entity (room alias, room ID, event within a room, user ID) is going to be sent over Matrix, | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| i.e. via message event, and | ||||||
| - unless breaking user intent, i.e. manually pasted links would not convert while tab-completed IDs would. | ||||||
|
|
||||||
| Features such as "share room by link" or a generic "right click to copy link" remain unchanged, since falling back to | ||||||
| the <https://matrix.to> web service remains reasonable outside of Matrix until browsers and/or operating systems widely | ||||||
| implement a default handler for `matrix:` to an appropriate onboarding experience. | ||||||
|
|
||||||
| This proposal is submitted in the hope that it supports the blanket adoption of `matrix:` URIs to work towards the | ||||||
| greater goal of maximising decentralisation per the [Matrix Manifesto](https://matrix.org/foundation/about/). | ||||||
|
|
||||||
| ## Potential issues | ||||||
|
|
||||||
| There might be "growing pains" as implementing this MSC effectively forces the ecosystem to at least support parsing | ||||||
| `matrix:` URIs. In reality, most clients already support this as of today. | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. matrix URI (room alias) client support:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW SchildiChat Revenge recently got matrix URI (plaintext) linkification and deeplinking support (to be released soon), just need to bump the message formatting library on Next to get linkification and in-app navigation on that as well
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There might be a discrepancy between iOS and Android here - plain-text URIs will link & pillify as expected on iOS.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I clarified Android above!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The matrix URI scheme has had first-class support in Quotient-based clients (Quaternion and NeoChat) since 2021, ftr. Implementing this MSC is almost exactly down to changing a single default in the library for them. |
||||||
|
|
||||||
| ## Alternatives | ||||||
|
|
||||||
| 1. Use [plain IDs](https://spec.matrix.org/v1.18/appendices/#common-identifier-format) instead of `matrix:` URIs with the | ||||||
| RECOMMENDATION to display them as navigable UX (e.g. links, "pills"). | ||||||
| 2. The outcome of this MSC could be the decision to stay with the preference for matrix.to for the fallback-to-the-web | ||||||
| benefit even for what is supposed to be Matrix-internal communication, and live with the consequence of not reaching the | ||||||
| same level of deeplinking other platforms have. | ||||||
| 3. A more radical approach to deprecate matrix.to not only internally, but also generally, would be possible. The author | ||||||
| believes the consequences of this would be too harsh, particularly towards onboarding, even though issues with the | ||||||
| current onboarding experience via <https://matrix.to> persist. | ||||||
|
|
||||||
| ## Security considerations | ||||||
|
|
||||||
| None known. | ||||||
|
|
||||||
| ## Unstable prefix | ||||||
|
|
||||||
| Not needed. | ||||||
|
|
||||||
| ## Dependencies | ||||||
|
|
||||||
| None. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this have to do with product teams? 🤔 It's an entirely internal technical detail that shouldn't be visible to users at all
I don't think this needs any implementation, since the spec already allows using
matrixURIs, there are already multiple clients that correctly handlematrix:URIs in<a>tags, and this is just a deprecation rather than a removal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I get where "Product teams" comes from I just wanted to mention that this feels a bit weird as a term considering a lot of clients are not done by companies in matrix ecosystem. So lots of them don't have such a team. This term feels almost a bit out of touch with the reality of matrix ecosystem. Sorry for being nitpicky. This isn't meant to be rude. I just wanted to mention this for next time maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the MSC is deliberately very conservative in that regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clients expose matrix.to in several places to users and this proposal requires that those clients don't do that. Why those clients haven't already made the switch is essentially the product decision to be made here.
The implementation requirements for a deprecation is typically evidence that it's safe to queue for removal. Because clients still actively use matrix.to by choice, we cannot queue this for removal.
If the proposal's purpose is to discourage use without targeting removal then it should not be using deprecation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd then need implementations of all of that to show it's feasible to rewrite
matrix:URIs to matrix.to URLs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was confused by why clients would need to rewrite
matrix:URIs to matrix.to URLs, but apparently it's because at least Element X decided that pills need a "copy link" context menu option. It's technically an existing spec compliance issue (the spec already allows usingmatrix:for pills), but it's fair to consider those before having the spec recommend actively switching tomatrix:URIs over matrix.to URLs, as such a recommendation will cause clients to hit the spec compliance issues a lot more.It's probably also better to start with having the spec just recommend
matrix:URIs ("Clients SHOULD usematrix:URIs when sending user and room mentions") before a formal deprecation of matrix.to in pills.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a client developer perspective (so-called product team 😂), I can confirm : Every major client supports the Matrix URI scheme. With the acceptance of
matrix:as standardized scheme, even web-clients can register to handle incoming Matrix URLs simple as by including it into the web app manifest.Matrix URIs are easier to handle since they tend to be less buggy. E.g., many Matrix clients as well as users manually writing links tend to fail at the URI component encoding of the sigils that's required according to the matrix.to scheme. With standardized Matrix URIs this issue is solved.
Imho, the following should be the way to go :
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, per the MSC that is reasonable and even implied as intended.
I can't help but feel like asking for POC implementations on no less than 4 platforms is chicanery for something that is obviously™️ a trivial find-replace. Why would this be necessary? I would even argue it's so trivial that it doesn't need an implementation. Both parsing and generating of both
matrix:and matrix.to URIs to/from IDs is already proven by their respective inclusion in the spec.Anyway, here's an implementation in bash:
Note that while the examples in the spec for matrix.to percent-encode ALL special chars, aiui this isn't required by RFC 3986.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obligatory reminder that I wrote the steps to
world dominationmatrix:URI scheme support 5 years ago: element-hq/element-web#16875 (comment) - and for as long as I remember, people mostly agreed by these steps, and nobody challenged them. This MSC (@HarHarLinks I owe you your favourite beverage at conf or somewhere for writing it) is a legislation for step 2 because apparently (and yes I'm looking at Element now) some "product teams" just can't prioritise it otherwise.