Skip to content

Conversation

sameoldlab
Copy link
Collaborator

@sameoldlab sameoldlab commented Mar 10, 2025

Sets up roomy to be built as a tauri app. Roomy successfully builds with Tauri, but is not fully usable as is.

Bugs / To-dos:

  • Entire page goes blank in Tauri's window anywhere next is imported from @automerge/automerge, even while displaying fine from the same dev server in a browser window
  • Cannot build with Deno for mobile. Using pnpm in tauri's config
  • { atproto } from '$lib/atproto.svelte.ts' is undefined in final builds (but present in dev)
  • Oauth works partially in the tauri window, but should be opened in the user's browser instead.
  • Android DeepLinks. Finishing setup requires a SHA256 fingerprint from whoever has the app's signing key

There's a script (setup-tauri.sh) to generate icons and the android build that add a lot of extra generated files to the repo. Depending on how the binaries eventually get built in CI, it might be better to add these into the repo otherwise they can just stay as part of setup.

@sameoldlab
Copy link
Collaborator Author

Oauth works partially in the tauri window, but should be opened in the user's browser instead.

Most of this works already, but we'd need to modify the redirectUri to get back a token from the user's authorization server. Two ways to do this are deep linking and a temp redirect server.

Deep-linking: Requires some json to be stored server-side, like what oauth-client does. But AFAIU, atproto's oauth spec allows a different scheme for native redirectUri's (com.example.app:/callback) from tauri (<scheme>://url). So we'd need to route this to the roomy web version, like /oauth/callback-native which would actually trigger the deeplink.

Redirect server: Spawns a server to handle the callback. Would need to change how atproto.init() works because the server's port is not known until the auth process has started (technically could use a static port number, but everything would fail if it's already in use).

@sameoldlab
Copy link
Collaborator Author

sameoldlab commented Mar 17, 2025

I put the client metadata for tauri in static/oauth-client-native.json so it gets bundled into tauri's binary. Tradeoff is that the domain is fixed across dev.roomy.chat and roomy.chat. Deep links from either url work, so it could be fetched/changed dynamically. Not sure if there's anything showing up in the app to use as a condition for that.

@erlend-sh erlend-sh requested a review from zicklag March 17, 2025 20:58
@zicklag
Copy link
Contributor

zicklag commented Mar 17, 2025

tradeoff is that domain fixed to across dev.roomy.chat and roomy.chat.

That sounds good for now. 👌

Don't worry about fixing / debugging the issue with the @automerge/automerge import because we're migrating to Loro very soon.

Is there anything else outstanding to do on this?

@sameoldlab
Copy link
Collaborator Author

sameoldlab commented Mar 18, 2025

Is there anything else outstanding to do on this?

@zicklag Just the key setup for android, but that isn't something I can do on my end. I haven't done any tests with beyond signing in because of the Automerge issue. Other than that should be ready to go.

@sameoldlab
Copy link
Collaborator Author

Merging it will break the rest of the app though because the automerge imports are commented out. I could undo that in the PR and leave a note for anyone trying to test it out

@zicklag
Copy link
Contributor

zicklag commented Mar 18, 2025

Just the key setup for android, but that isn't something I can do on my end.

That's fine, we can do that once we're ready to publish to android.

Merging it will break the rest of the app though because the automerge imports are commented out. I could undo that in the PR and leave a note for anyone trying to test it out

Ah, yeah, that sounds good. 👍

Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for roomy-dev failed.

Name Link
🔨 Latest commit b874f1f
🔍 Latest deploy log https://app.netlify.com/sites/roomy-dev/deploys/67d9d3dbb163800008033563

@sameoldlab sameoldlab marked this pull request as ready for review March 18, 2025 20:13
@zicklag zicklag merged commit 5cc5991 into muni-town:main Mar 18, 2025
0 of 4 checks passed
@sameoldlab sameoldlab deleted the feat/tauri-integrated branch March 18, 2025 20:21
This was referenced Mar 30, 2025
@sameoldlab sameoldlab restored the feat/tauri-integrated branch March 31, 2025 19:48
@sameoldlab sameoldlab deleted the feat/tauri-integrated branch March 31, 2025 19:49
@michaelwschultz michaelwschultz moved this to Todo in Roomy Apr 15, 2025
@michaelwschultz michaelwschultz moved this from Todo to Done in Roomy Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants