fix(crypto): spell AppHandle with the runtime so the CEF build compiles (#1988)

<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Fixes #

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).

<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
This commit is contained in:
Erwan Leboucher authored and GitHub committed 2026-08-28 19:35:06 +02:00
commit 823d975456
3 files changed
+17 -6

No files matched your search

+9 -2
View File
@@ -33,7 +33,11 @@ fn withheld_json(info: &RoomKeyWithheldInfo) -> Value {
/// One task per stream. The returned handles must be aborted when the engine is
/// closed: the streams outlive the machine, so they would otherwise keep the
/// listeners alive for an account that is no longer open.
pub fn spawn(app: &AppHandle, machine: &OlmMachine, account: String) -> Vec<JoinHandle<()>> {
pub fn spawn(
app: &AppHandle<crate::BrowserEngine>,
machine: &OlmMachine,
account: String,
) -> Vec<JoinHandle<()>> {
let store = machine.store();
let mut room_keys = store.room_keys_received_stream();
@@ -41,7 +45,10 @@ pub fn spawn(app: &AppHandle, machine: &OlmMachine, account: String) -> Vec<Join
let mut identities = store.identities_stream_raw();
let mut secrets = store.secrets_stream();
let emit = |app: AppHandle, event: &'static str, account: String, payload: Value| {
let emit = |app: AppHandle<crate::BrowserEngine>,
event: &'static str,
account: String,
payload: Value| {
// A failed emit means the webview is gone; the abort on close is what
// stops these tasks, so there is nothing to recover here.
let _ = app.emit(event, json!({ "account": account, "payload": payload }));
+7 -3
View File
@@ -122,7 +122,11 @@ pub fn store_subpath(user_id: &str, device_id: &str) -> PathBuf {
/// Per-account store directory. Resolved here rather than passed in so the
/// webview never has to know an absolute path, and so the native notification
/// handler can derive the same location independently.
fn store_dir(app: &tauri::AppHandle, user_id: &str, device_id: &str) -> Result<PathBuf, String> {
fn store_dir(
app: &tauri::AppHandle<crate::BrowserEngine>,
user_id: &str,
device_id: &str,
) -> Result<PathBuf, String> {
let base = match app_group_dir() {
Some(shared) => shared,
None => app
@@ -182,7 +186,7 @@ pub async fn open_machine(
#[tauri::command]
pub async fn engine_open(
app: tauri::AppHandle,
app: tauri::AppHandle<crate::BrowserEngine>,
dir: Option<String>,
passphrase: Option<String>,
user_id: String,
@@ -213,7 +217,7 @@ pub async fn engine_close(user_id: String, device_id: String) -> Result<bool, St
#[tauri::command]
pub async fn engine_wipe(
app: tauri::AppHandle,
app: tauri::AppHandle<crate::BrowserEngine>,
user_id: String,
device_id: String,
) -> Result<(), String> {
+1 -1
View File
@@ -117,7 +117,7 @@ pub async fn decrypt_push(
/// with no webview alive there is nothing to invoke a command.
#[tauri::command]
pub async fn engine_decrypt_push(
app: tauri::AppHandle,
app: tauri::AppHandle<crate::BrowserEngine>,
user_id: String,
device_id: String,
room_id: String,