Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.
`code_required` (below). A server and a computer must be upgraded together: an older computer has
no `/sign-in/code`.

### A reinstall no longer picks up the previous installation's Bot files and sign-ins

A desktop installation set up again after its folder was deleted reused whatever the previous one
left in the container engine: Bot workspace files, and each Bot's browser profile with its website
sign-ins, under the same Bot ids. Only the database was checked. Start now lists every volume and
stopped container the previous installation left, and offers one confirmed reset that removes them;
nothing is reused without asking. A container from it that is still running stops the reset until it
is stopped. An installation with its saved key keeps its data as before.

### A new desktop install starts its server again

A desktop install of v0.2.0 stopped at start with `server stopped straight away (exit status: 1)` and
Expand Down
499 changes: 424 additions & 75 deletions desktop/src-tauri/src/main.rs

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions desktop/src-tauri/src/problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ pub struct Problem {
/// The full, verified Compose volume name offered for an explicit fresh-install reset.
#[serde(skip_serializing_if = "Option::is_none")]
pub database_reset: Option<String>,
/// A verified fresh-install reset of everything a previous installation left behind.
/// Boxed and flattened: the window reads `leftover_reset` and `leftover_containers`.
#[serde(flatten, skip_serializing_if = "Option::is_none")]
pub leftover: Option<Box<LeftoverReset>>,
}

/// Exactly what one confirmed reset removes: the containers first, then the volumes.
#[derive(Clone, Debug, Default, Serialize, PartialEq, Eq)]
pub struct LeftoverReset {
/// Every verified volume, the database included.
#[serde(rename = "leftover_reset", skip_serializing_if = "Vec::is_empty")]
pub volumes: Vec<String>,
/// Stopped containers that still hold those volumes.
#[serde(rename = "leftover_containers", skip_serializing_if = "Vec::is_empty")]
pub containers: Vec<String>,
}

impl Problem {
Expand All @@ -46,6 +61,7 @@ impl Problem {
detail: None,
connection: None,
database_reset: None,
leftover: None,
}
}

Expand All @@ -57,9 +73,22 @@ impl Problem {
detail: (!detail.trim().is_empty()).then_some(detail),
connection: None,
database_reset: None,
leftover: None,
}
}

/// The volumes a confirmed reset removes, or none when no reset is offered.
pub fn leftover_volumes(&self) -> &[String] {
self.leftover.as_deref().map_or(&[], |reset| &reset.volumes)
}

/// The stopped containers a confirmed reset removes before those volumes.
pub fn leftover_containers(&self) -> &[String] {
self.leftover
.as_deref()
.map_or(&[], |reset| &reset.containers)
}

pub fn connection(mut self, connection: Connection) -> Self {
self.connection = Some(connection);
self
Expand Down
Loading
Loading