Page MenuHomePhabricator

[keyserver][native] Fix invite links setup
ClosedPublic

Authored by tomek on Jun 20 2023, 4:28 AM.
Tags
None
Referenced Files
F3389299: D8255.diff
Fri, Nov 29, 6:30 PM
Unknown Object (File)
Mon, Nov 25, 2:48 PM
Unknown Object (File)
Sat, Nov 23, 1:05 PM
Unknown Object (File)
Sat, Nov 23, 7:03 AM
Unknown Object (File)
Sat, Nov 23, 3:55 AM
Unknown Object (File)
Wed, Nov 20, 5:58 PM
Unknown Object (File)
Wed, Nov 20, 5:58 PM
Unknown Object (File)
Wed, Nov 20, 5:58 PM
Subscribers

Details

Summary

Our invite link url is https://comm.app/invite/:secret.

In our prod setup, we forward all the traffic from comm.app to localhost:3000/commlanding, which means that our invite link gets replaced by localhost:3000/commlanding/invite/:secret and that means that we should handle this route in landing router. It doesn't hurt to also support it in web router - /invite/:secret gets replaced later by /handle/invite/:secret, so it doesn't cause any issue, but has a benefit that in some other configs would still work.

In inviteResponder for web, we were assuming that the route is handled by web router. This is no longer the case, and we have to explicitly forward to web url.

The final issue was that, our invite links for iOS and Android were configured for web.comm.app domain instead of comm.app. This requires updating inviteResponder for iOS (as there's a link url), and Comm.entitlements. In order to avoid redirecting all the traffic from comm.app to the mobile app, we have to introduce some filtering: for iOS, we modify AASA file to only handle /invite route. For Android, we set pathPrefix in Manifest.

https://linear.app/comm/issue/ENG-4089/invite-links-dont-work-on-prod

Test Plan

Some changes can't be tested yet, as we have to update .well-known files on server for the deep links on native to be updated.
The part with landing was tested by checking if accessing /commlanding/invite/:secret results in web app /handle/invite/:secret route being accessed.

Diff Detail

Repository
rCOMM Comm
Branch
invite-web
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/keyserver.js
130–134

This comment wasn't too accurate. I removed it and replaced by a new comment for inviteResponder.

tomek requested review of this revision.Jun 20 2023, 4:46 AM
keyserver/src/keyserver.js
112

Wondering, why do we need this route for both web and landing?

keyserver/src/keyserver.js
112

I tried to describe it in a summary, but regardless, it doesn't matter for our current setup. It also doesn't hurt.

The potential benefit is that if someone would configure web to be served at comm.app the links would still work.

This revision is now accepted and ready to land.Jun 22 2023, 5:41 AM
This revision was automatically updated to reflect the committed changes.