4.2 KiB
4.2 KiB
Audit Log
2026-04-25
Found and fixed 3 issues:
- Perf: O(n²) deletion-detection in
get_sync_status(sync.rs:918) — for every path tracked insync_state.files, the loop scannedlocal_fileslinearly via.any(|f| f.path == *path)to decide whether to count it as a deleted-locally pending change. The earlier "modified or new" loop already used the inverse direction withsync_state.files.get(...)(O(1)), so the second loop was the inconsistent one. Built aHashSet<&str>of local paths once and usedcontainsfor the membership check. - Perf: cascade delete walks all_tasks per frontier pop (tauri/lib.rs:460) —
delete_task's descendant BFS scanned the full task list on every parent popped from the frontier, making the work O(n × depth). Built aparent_id -> [child_id]HashMaponce, then the BFS visits each descendant in O(1) amortised, dropping total cost to O(n). - Code quality: duplicate atomic-write in
AppConfig::save_to_file(config.rs:114) — the function had its own copy of the temp-file + rename + cleanup-on-failure dance even thoughstorage::atomic_writeispub(crate)and was already shared bygoogle_tasks.rs. Replaced the inline implementation with a call tocrate::storage::atomic_writeso the crate has one canonical atomic write path.
2026-04-24
Found and fixed 3 issues:
- Bug: orphan base entries never cleaned from sync state (sync.rs) — when a file was deleted both locally and remotely,
compute_sync_actionsemitted no action (the(None, None, Some(_))arm), so the base entry in.syncstate.jsonpersisted forever. On each subsequent sync the same no-op case fired and the state file grew. Addedprune_orphan_basespass insync_workspace_innerthat drops base entries not present in either scan. - Code quality: redundant is_some_and on already-matched Option (sync.rs:208) — the
(None, Some(_), Some(b))arm re-checkedremoteviaremote.is_some_and(|r| ...)even though the pattern had just provenremoteisSome(_). Bound the inner value withSome(r)in the pattern and usedrdirectly. - Code quality: single-caller sanitize_filename wrapper (storage.rs) —
FileSystemStorage::sanitize_filenamewas a one-line forwarder tocrate::sanitize_filenamewith one call site. Inlined the crate call and removed the method.
2026-04-20
Found and fixed 4 issues:
- Dead code in conflict recovery (sync.rs:756) —
parts[1] != ".listdata.json"was unreachable because the branch is already gated onparts[1].ends_with(".md"), which.listdata.jsoncannot satisfy. Removed the redundant check. - O(n²) cascade delete (tauri/lib.rs) — descendant traversal in
delete_taskusedVec::containsinside the inner loop, making it quadratic in the number of tasks per list. Swapped the visited set toHashSet;HashSet::insertfolds the contains+push into one call. - Silent cascade failure in toggle_task (tauri/lib.rs) — subtask
update_taskerrors were discarded withlet _ = ..., leaving subtasks stuck at the old status with no UI feedback. Propagate the error so the frontend can surface it. - Duplicated UUID-parse boilerplate (tauri/lib.rs) — 17 commands repeated
Uuid::parse_str(&x).map_err(|e| e.to_string())?. Extracted aparse_uuidhelper so callers read aslet id = parse_uuid(&list_id)?;.
2026-04-15
Found and fixed 4 issues:
- Bug: debouncedSave shared timer loses edits (TaskDetailView.svelte) - When user edits both title and description within 400ms, only the last-edited field was saved. Fixed by always saving both fields in the debounced callback.
- Code duplication: atomic_write_bytes (google_tasks.rs) - Identical copy of
atomic_writefrom storage.rs. Removed duplicate and reused the sharedpub(crate)function. - Bug: silent success on missing workspace (lib.rs) - Four Tauri commands (
set_webdav_config,set_workspace_theme,set_sync_interval,set_sync_interval_unfocused) silently succeeded when given a nonexistent workspace ID. Fixed to return an error. - Bug: failing test due to wrong frontmatter field name (storage.rs) -
test_parse_frontmatter_with_optional_fieldsuseddue:instead ofdate:in frontmatter YAML, causing the assertion onfm.date.is_some()to fail.