Git Product home page Git Product logo

Comments (8)

AsbjornOlling avatar AsbjornOlling commented on July 19, 2024 1

Maintainer of Cactus Comments here.
I was just made aware of this bug in matrix.to because a friend of mine has broken links on their blog because of it as well.
It seems to still be an issue.

from matrix.to.

Zocker1999NET avatar Zocker1999NET commented on July 19, 2024

this probably happens because the parser does split the fragment (except the common prefix) by / (for the event id) before checking where the local part ends:

const [identifier, eventId] = linkStr.split("/");

from matrix.to.

ahmedakef avatar ahmedakef commented on July 19, 2024

this issue made me stop using https://cactus.chat/ in my static website and will instead use https://giscus.app/

from matrix.to.

pombredanne avatar pombredanne commented on July 19, 2024

We have likely the same issue:

If I "copy the room link" in Element Desktop (or Web too BTW), https://matrix.to/#/#aboutcode-org/fosdem-2024:gitter.im is the link copied

But this is a dead, invalid link. It should have been
https://app.gitter.im/#/room/#aboutcode-org/fosdem-2024:gitter.im

matrix.to does not redirect correctly rooms with a slash.

from matrix.to.

pombredanne avatar pombredanne commented on July 19, 2024

I am experiencing the same issue and I originally thought this was an Element problem. element-hq/element-desktop#1435 ... this makes life really difficult as the generated matrix.to links are useless and error out. So you cannot really share you room at all.

from matrix.to.

pombredanne avatar pombredanne commented on July 19, 2024

as @Zocker1999NET pointed out the split is the issue. Here is a simple excerpt:

function parseFragment(fragment) {
        let [linkStr, queryParamsStr] = fragment.split("?");
        linkStr = linkStr.slice(2);
        const [identifier, eventId] = linkStr.split("/");
        return {"identifier": identifier, "eventId": eventId};
    }
parseFragment("/#aboutcode-org/vulnerablecode:gitter.im")

returns:

Object { identifier: "aboutcode-org", eventId: "vulnerablecode:gitter.im" }

But should have returned:

Object { identifier: "aboutcode-org/vulnerablecode:gitter.im", eventId: "" }

Also I could not find a tests for this function... are they in another repository may be? 😇

from matrix.to.

shadow-identity avatar shadow-identity commented on July 19, 2024

Neither unescaped (https://matrix.to/#/@it/sme:matrix.org) nor escaped (https://matrix.to/#/@it%2Fsme:matrix.org) links does not work.

from matrix.to.

shadow-identity avatar shadow-identity commented on July 19, 2024

Also the error message is misleading because the URL is actually valid

> new URL('https://matrix.to/#/@it/sme:matrix.org')
> URL {
hash: "#/@it/sme:matrix.org"
host: "matrix.to"
hostname: "matrix.to"
href: "https://matrix.to/#/@it/sme:matrix.org"
origin: "https://matrix.to/"
password: ""
pathname: "/"
port: ""
protocol: "https:"
search: ""
searchParams: URLSearchParams(0)
username: ""
}

from matrix.to.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.