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

Handle pressing all go.bsky.app links in-app w/ resolution #4680

Merged
merged 12 commits into from
Jun 28, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Jun 27, 2024

Why

We want to be able to resolve any short links in the app, even if they don't get resolved while posting. This is a little challenging because we have to reach out to go.bsky.app first. I added JSON response support in #4671, which we can now use to perform resolution when landing on these.

How

  1. First, we click on a link in the app. We already check for if links start with bsky.app but we don't check go.bsky.app which we add here.
  2. We then push to the StarterPackScreenShort route
  3. The short route attempts to resolve the real URI and then render the starter pack screen with the resolved did and rkey

The nice thing here is this is extensible to other schemes whenever we want to. For example, post short links - which we are less worried about being very short - could use /p/123456 and we could create a resolve query for those types of links.

Test Plan

RocketSim_Recording___RNIDE_TEMP_SIM_com apple CoreSimulator SimDeviceType iPhone-15-Pro_6 1_2024-06-27_12 43 20

Copy link

render bot commented Jun 27, 2024

Copy link

github-actions bot commented Jun 27, 2024

Old size New size Diff
6.48 MB 6.48 MB 2.63 KB (0.04%)

@haileyok haileyok marked this pull request as ready for review June 27, 2024 19:44
Comment on lines 330 to 334
<Stack.Screen
name="StarterPackShort"
getComponent={() => StarterPackScreenShort}
options={{title: title(msg`Starter Pack`), requireAuth: true}}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new route that accepts a code parameter rather than name and rkey

@haileyok haileyok force-pushed the hailey/json-resolution-short-links branch from 55457c1 to 3385238 Compare June 28, 2024 00:21
Comment on lines -115 to -117
setActiveStarterPack({
uri: starterPack.uri,
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing this since it is unneeded. No change in functionality.

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have not run, code lgtm (after discussed changes)

@haileyok
Copy link
Contributor Author

Retested signup flow w/ a starter pack, works good. This is a little funky as noted but is mostly a corner case.

@haileyok haileyok merged commit 91c4aa7 into main Jun 28, 2024
6 checks passed
@haileyok haileyok deleted the hailey/json-resolution-short-links branch September 2, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants