Page MenuHomePhabricator

[keyserver] Introduce endpoint for deep linking
ClosedPublic

Authored by tomek on Mar 28 2023, 2:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 1:51 PM
Unknown Object (File)
Wed, Apr 3, 8:02 AM
Unknown Object (File)
Wed, Apr 3, 8:02 AM
Unknown Object (File)
Wed, Apr 3, 8:02 AM
Unknown Object (File)
Wed, Apr 3, 8:02 AM
Unknown Object (File)
Wed, Apr 3, 8:01 AM
Unknown Object (File)
Wed, Apr 3, 7:55 AM
Unknown Object (File)
Mar 12 2024, 5:19 AM
Subscribers

Details

Summary

This endpoint won't be accessed when the app is installed - opening it on a mobile device should deep link to the app. If the app isn't installed, this endpoint will be called on the server side. Then we can redirect the user to the store. At this point only the App Store is supported but later in the stack Google Play will be also handled - based on the user agent. This is also the place where deferred part of linking will happen - setting referrer or clipboard item.

Depends on D7216 D7231

Test Plan

Create a test page containing a link to /invite/:secret. Clicking this link on a device with installed app results in opening the app with appropriate initialURL set. Clicking it on other devices opens the App Store.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Mar 28 2023, 2:29 AM
ashoat added inline comments.
keyserver/src/keyserver.js
11 ↗(On Diff #24265)

Hmm, this seems like a strange place for this import, but I guess ESLint is passing. Usually we see the lib imports in their own section

131 ↗(On Diff #24265)

I'm guessing we'll do some work later to determine whether it's iOS vs. Android via the query string. @kamil is working on another case where we need to do browser detection on the keyserver in D7188, and I suggested adding browser-detect to the keyserver for that

landing/qr.react.js
37 ↗(On Diff #24265)

Thanks for catching this!

This revision is now accepted and ready to land.Mar 28 2023, 5:48 AM
keyserver/src/keyserver.js
11 ↗(On Diff #24265)

Yeah, that's strange. I guess an import from cron might be confusing ESLint a little bit. I'll check if moving this import works.

131 ↗(On Diff #24265)

That's correct - we will redirect to different url depending on the platform. I think we can do that based on user-agent. Using query string would require different urls for different platforms and I don't think it would be convenient (have to think about it).

keyserver/src/keyserver.js
131 ↗(On Diff #24265)

Oops sorry I meant to say user agent instead of query string!

keyserver/src/keyserver.js
11 ↗(On Diff #24265)

I think ESLint ignores the "naked imports" like ./cron/cron.js because it assumes they have side effects, and so the order probably matters for those

Personally I would move the import './cron/cron.js'; to be next to the other local imports if possible, but it doesn't matter much