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

QSS: Update Quiet client to detect a v2 invite link format #2310

Open
leblowl opened this issue Feb 21, 2024 · 5 comments
Open

QSS: Update Quiet client to detect a v2 invite link format #2310

leblowl opened this issue Feb 21, 2024 · 5 comments
Assignees

Comments

@leblowl
Copy link
Collaborator

leblowl commented Feb 21, 2024

When joining, when a user enters an invite link, Quiet should be able to detect the new invite link format, and if it’s a v2 invite link, then call DOWNLOAD_INVITE_DATA before continuing with the flow.

Mobile launches the deepLink saga on start. We can update deepLinkSaga to detect the invite link type and if it’s a v2 type, call DOWNLOAD_INVITE_DATA and then dispatch the createNetwork action with the returned invite data just like the deepLinkSaga already does.

Desktop deals with parsing the invite data in main.ts and then calls customProtocolSaga. We can simplify things by refactoring customProtocolSaga to act more like mobile’s deepLinkSaga and contain the invite parsing code. In customProtocolSaga, we can also detect if we receive a v2 type link and call DOWNLOAD_INVITE_DATA and then dispatch createNetwork action with the returned invite data.

@EmiM
Copy link
Collaborator

EmiM commented Feb 29, 2024

I'm missing the clear definition of "v2 invite link".

Based on that information - https://docs.google.com/document/d/1dWWwthyJAoNl6sRT5oBGFnuNnYJiU8ZEn7W5Cm1zPRI/edit#heading=h.g05xbtyae2g I would assume that the format looks like that:

https://tryquiet.org/join/?s=<server_url>&CID=<cid>&i=<inviterAadress> or <peerId><someConnector><onionAddress>

So example invitation url would be:

https://tryquiet.org/join/?s=https://tryquiet.org/api/invite/&CID=QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n&i=Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6-y7yczmugl2tekami7sbdz5pfaemvx7bahwthrdvcbzw5vex2crsr26qd

or (if inviter address is just onion address):

https://tryquiet.org/join/?s=https://tryquiet.org/api/invite/&CID=QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n&i=y7yczmugl2tekami7sbdz5pfaemvx7bahwthrdvcbzw5vex2crsr26qd

@leblowl could you confirm?

I think we decided that in first iterations <server_url> will be hardcoded (pointing to our server). I'd also make it customizable for devs so they can use relay server on localhost.

@leblowl
Copy link
Collaborator Author

leblowl commented Mar 4, 2024

I might start with something like: https://tryquiet.org/join#c=<cid>&t=<token>&i=<inviter_onion_address> The api.tryquiet.org/invite part can be hard-coded, so I don't think we need a s=<server_url> part yet. But it might also be good to check if we meet linkify (length) requirements even with an s=<server_url> part and i=<inviter_address>. I think we probably do, but would be interesting to see how much space we have left in the link.

@holmesworcester
Copy link
Contributor

One nice thing about having s=<server_url> is that we won't need to change the link in the future when someone wants to run their own server.

@EmiM
Copy link
Collaborator

EmiM commented Mar 4, 2024

Yeah, I was thinking to add this now if it's low cost and not worry about adjusting invitation link format later

@leblowl leblowl changed the title Relay: Update Quiet client to detect a v2 invite link format QSS: Update Quiet client to detect a v2 invite link format Mar 4, 2024
@EmiM
Copy link
Collaborator

EmiM commented Mar 6, 2024

#2330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

No branches or pull requests

3 participants