Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ first added in the same Unreleased section is not an entry: edit that entry inst

### Breaking

- A new store format (assignees, dispatch, blocks, reviews, after, paper trail, wider undo). Older tsk refuses it; to roll back, restore the `tsk.json.v5` copy.
- Store format 6: assignees, dispatch, blocks, reviews, after, paper trail, wider undo. Older tsk refuses it; to roll back, restore the `tsk.json.v5` copy.

### Added

Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ tsk restore

## Store version

Older tsk refuses a newer store. tsk keeps a `tsk.json.v<N>` copy when it upgrades the file.
This version writes store format 6. tsk 0.12 and older refuse a format 6 store, as older tsk refuses any newer store. tsk keeps a `tsk.json.v<N>` copy when it upgrades the file.

To roll back: quit every board, then copy `tsk.json.v<N>` over `tsk.json`. Changes made since the upgrade are lost.

Expand Down
4 changes: 2 additions & 2 deletions src/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ every = "daily"

#[test]
fn counts_tasks_without_notices_or_deleted() {
let document = br#"{"format_version":13,"tasks":[{"title":"a"},{"title":"n","notice":{"kind":"x"}},{"title":"d","soft_deleted":true},{"title":"b","notice":null}]}"#;
let document = br#"{"format_version":6,"tasks":[{"title":"a"},{"title":"n","notice":{"kind":"x"}},{"title":"d","soft_deleted":true},{"title":"b","notice":null}]}"#;
assert_eq!(count_tasks(document), Some(2));
assert_eq!(count_tasks(b"nope"), None);
}
Expand Down Expand Up @@ -2336,7 +2336,7 @@ every = "daily"
let state = state_with_target(&root.0, &remote, "");
fs::write(
state.join("tsk.json"),
b"{\"format_version\":13,\"tasks\":7}",
b"{\"format_version\":6,\"tasks\":7}",
)
.expect("store");
let results = run(&state, RunMode::Now, at(DAY)).expect("run");
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7264,8 +7264,8 @@ mod tests {
}

#[test]
fn cleaned_marker_is_optional_and_store_format_stays_v15() {
assert_eq!(crate::domain::STORE_FORMAT_VERSION, 15);
fn cleaned_marker_is_optional_and_store_format_stays_v6() {
assert_eq!(crate::domain::STORE_FORMAT_VERSION, 6);
let record = Dispatch {
argv: vec!["agent".into()],
worktree: "/tmp/worktree".into(),
Expand Down
4 changes: 2 additions & 2 deletions src/domain/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ fn base_detail(base: &Option<String>) -> Option<EventDetail> {
}

/// Document version written by this binary.
pub const STORE_FORMAT_VERSION: u32 = 15;
pub const STORE_FORMAT_VERSION: u32 = 6;

fn default_next_notice_number() -> u64 {
1
Expand Down Expand Up @@ -611,7 +611,7 @@ pub struct DomainState {
#[serde(skip)]
project_intents: BTreeMap<String, bool>,
/// Person names removed from the assignee picker. Tasks keep them; only the picker's
/// list skips them. Absent before v15, and left out of the document while empty.
/// list skips them. Absent before v6, and left out of the document while empty.
#[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
hidden_assignees: BTreeSet<String>,
/// This process's not-yet-saved hide (true) and unhide (false) intents, re-applied after
Expand Down
10 changes: 5 additions & 5 deletions src/domain/undo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use super::{AssigneeKind, BlockOn, DomainError, DomainState, HumanStatus, Step};
/// Maximum undo entries retained in a saved document.
pub const UNDO_CAP: usize = 50;

/// What a done entry written before store v13 restores: `open`.
fn pre_v13_previous() -> HumanStatus {
/// What a done entry written before store v6 restores: `open`.
fn pre_v6_previous() -> HumanStatus {
HumanStatus::Open
}

Expand All @@ -23,16 +23,16 @@ pub enum UndoEntry {
id: Uuid,
expected_revision: Uuid,
},
/// A done; reversing restores `previous`. An entry written before store v13 carries no
/// A done; reversing restores `previous`. An entry written before store v6 carries no
/// `previous` and reads as `open`, the status such an undo always went back to.
Complete {
id: Uuid,
#[serde(default = "pre_v13_previous")]
#[serde(default = "pre_v6_previous")]
previous: HumanStatus,
expected_revision: Uuid,
},
/// An assignment; reversing restores `previous` with its kind. An entry written before
/// store v14 carries no kind and reads as an agent, the only kind there was.
/// store v6 carries no kind and reads as an agent, the only kind there was.
Assign {
id: Uuid,
previous: Option<String>,
Expand Down
Loading