Skip to content

(1) Use the server to send messages between apps when adding an app. (2) Support notifications for multiple apps in the server.#132

Merged
jkaczman merged 3 commits into
mainfrom
multi-apps
Jun 30, 2026
Merged

(1) Use the server to send messages between apps when adding an app. (2) Support notifications for multiple apps in the server.#132
jkaczman merged 3 commits into
mainfrom
multi-apps

Conversation

@arrdalan

@arrdalan arrdalan commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

This PR provides the functionality needed to support multiple (mobile_client) apps to use one camera.

fixes secluso/mobile_client#50

…(2) Support notifications for multiple apps in the server.

@jkaczman jkaczman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! A couple comments from an initial look.

Comment thread app_native/Cargo.toml Outdated
Comment thread client_lib/src/pairing.rs
wifi_password: None,
};

let qr_content = serde_json::to_string(&add_app_secret)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's possible that the two phones may not be on the same relay. There should be some check for this instead of it failing with (what I'm guessing is) a generic fail error. I suppose this would need to be embedded in the QR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In regard to what we just discussed on call: it's due to /add_app_check and /add_app_request. If they have different relays, those two endpoints we have for connecting them will just time-out due to no connection.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Another thought: the new relay design will need something like this in the QR as well because users share a "plan" for a given camera.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added this to secluso/mobile_client/#90. The app now checks to make sure both phones are connected to the same relay with the same username.

Comment thread server/src/fcm.rs

@jkaczman jkaczman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I also had another question (not related to these changes necessarily, but multi-app in general): we use a ref_counter based on num_apps at the time of uploading an encrypted file. What if num_apps was to be 1 when uploading and then another phone is added before that file is downloaded?

Comment thread server/src/main.rs
@arrdalan

Copy link
Copy Markdown
Collaborator Author

I also had another question (not related to these changes necessarily, but multi-app in general): we use a ref_counter based on num_apps at the time of uploading an encrypted file. What if num_apps was to be 1 when uploading and then another phone is added before that file is downloaded?

This shouldn't be an issue. When an app is added, the camera sends the MLS epoch value at which the app should start downloading videos. If an encrypted video is uploaded to the server before the new app is added, it will have a num_app of 1 and the new app will not try to download it. If an encrypted video is uploaded after the new app is added, it will have a num_app of 2 and the new will try to download it.

@jkaczman jkaczman self-requested a review June 30, 2026 19:16

@jkaczman jkaczman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. Thank you!

@jkaczman jkaczman merged commit a38c1e0 into main Jun 30, 2026
10 checks passed
@jkaczman jkaczman deleted the multi-apps branch June 30, 2026 19:17
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.

Add UI needed to add a second app to the camera group

2 participants