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

Incorrectly assuming all links with /c/ are Lemmy links #343

Closed
ajsosa opened this issue Jul 12, 2023 · 4 comments
Closed

Incorrectly assuming all links with /c/ are Lemmy links #343

ajsosa opened this issue Jul 12, 2023 · 4 comments
Labels
bug Something isn't working fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version
Milestone

Comments

@ajsosa
Copy link
Collaborator

ajsosa commented Jul 12, 2023

Issue

Clicking on links with paths that start with /c/rest-of-path get incorrectly treated as a Lemmy link.

Example

https://catbox.moe/c/rk6abk

So when clicked within app, Thunder tries to open it as if it were a community.

Reference

https://lemmy.world/post/1369784

@ajsosa ajsosa added the bug Something isn't working label Jul 12, 2023
@hjiangsu
Copy link
Member

hjiangsu commented Jul 12, 2023

I believe I need some stronger regex rules for figuring out lemmy links - linking this since it seems like we can follow lemmy-ui's regex:

https://github.com/LemmyNet/lemmy-ui/blob/021677316d290062a8c3bafdbec668dd8ebb3b85/src/shared/config.ts#L31-L39

@micahmo
Copy link
Member

micahmo commented Jul 12, 2023

it seems like we can follow lemmy-ui's regex: https://github.com/LemmyNet/lemmy-ui/blob/021677316d290062a8c3bafdbec668dd8ebb3b85/src/shared/config.ts#L31-L39

Unfortunately that regex is pretty limited in what it matches. It requires the full community@instance name.

image

EDIT: I don't know how we can definitively/preemptively determine that a given link goes to a Lemmy instance. Maybe we can ping it with the API client?

@ajsosa
Copy link
Collaborator Author

ajsosa commented Jul 12, 2023

Yeah that's probably the simplest solution. Do a ping to check if the community exists and have that decide how to open link.

This was referenced Jul 13, 2023
@micahmo micahmo added the fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version label Jul 31, 2023
@micahmo micahmo added this to the v0.2.1+14 milestone Jul 31, 2023
@micahmo
Copy link
Member

micahmo commented Sep 6, 2023

This fix should be in the latest general release.

@micahmo micahmo closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version
Projects
None yet
Development

No branches or pull requests

3 participants