Leave a team, delete a vault; keep tests out of the real settings

- A hub test unset LUNE_HOME for the whole test run, so later tests saved
  into the real user's config. Tests now always keep their own settings
  folder.
- Leaving a team: `lunesync leave` and the app's Leave hand over and remove
  this device there; a hub that's gone can be forgotten (folders stay).
- Deleting a vault (owner): everyone is removed the usual way, the history
  is archived on the hub and the name is freed. Canvas asks first.
- Connect this Mac says what to do when Lune isn't installed.
- Update checks skip http hubs instead of failing for all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 14:36:46 +07:00
parent 7d1437e3ec
commit 4f6414b256
16 changed files with 278 additions and 10 deletions

View File

@@ -249,6 +249,15 @@ pub fn tidy(vault: String, copy: String, keep: String) -> Answer<()> {
})
}
/// Leaves a team on this Mac. `forget` drops a hub that can't be reached (its folders stay).
#[tauri::command(async)]
pub fn leave_team(team: String, forget: bool) -> Answer<String> {
let mut config = Config::load().map_err(plain)?;
config.use_hub_credentials();
let said = lune_core::membership::leave_hub(&mut config, &team, forget).map_err(plain)?;
Ok(said.last().cloned().unwrap_or_default())
}
pub fn open_canvas_now(app: &AppHandle, team: Option<&str>) -> Answer<()> {
let config = Config::load().map_err(plain)?;
let hub = config.pick_hub(team).map_err(plain)?;

View File

@@ -224,7 +224,8 @@ pub async fn check_for_update(app: &AppHandle) {
if !configured {
return; // a build without the hub's public key can't verify updates, so it doesn't take any
}
let endpoints = hubs.iter().filter_map(|h| format!("{}/api/update/{{{{target}}}}/{{{{arch}}}}/{{{{current_version}}}}", h.url).parse().ok());
// Updates only come over https (the updater refuses anything else, and one http hub would stop them all).
let endpoints = hubs.iter().filter(|h| h.url.starts_with("https://")).filter_map(|h| format!("{}/api/update/{{{{target}}}}/{{{{arch}}}}/{{{{current_version}}}}", h.url).parse().ok());
let result = async {
let updater = app
.updater_builder()
@@ -354,6 +355,7 @@ fn main() {
commands::compare,
commands::tidy,
commands::open_canvas,
commands::leave_team,
commands::open_folder,
commands::restart,
])