diff --git a/.gitignore b/.gitignore index de2383f..dc59fe3 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ src-tauri/gen/ .claude/settings.local.json .claude/scheduled_tasks.lock .claude/worktrees/ +decisions-log.md diff --git a/decisions-log.md b/decisions-log.md deleted file mode 100644 index d294719..0000000 --- a/decisions-log.md +++ /dev/null @@ -1,8 +0,0 @@ -## Issue #155 — fetch_price token loading refactor (MEDIUM) -The existing `license_commands.rs` token loading lives in `activation_path()` + `fs::read_to_string()` spread across the file — no single public helper reads the activation token. To keep tests clean (avoid touching the file system), the implementation extracts a private `fetch_price_with_token(token, symbol, date)` function and a thin public `fetch_price` wrapper that reads the activation token from disk and delegates. Tests call the inner function directly, injecting a fake token string. This avoids the need for a temp file setup in every test, keeps the coupling minimal, and matches the existing pattern used in `validate_with_key` (pure inner fn + thin Tauri command wrapper). - -## Issue #155 — FetchPriceError serialization format (MEDIUM) -The `Result` boundary requires serializing `FetchPriceError` to a `String`. Chosen: `serde_json::to_string(&err).unwrap_or("{\"code\":\"internal\"}".to_string())`. This gives the JS layer a stable JSON string it can `JSON.parse()` to read the `code` field and the optional `retry_after_s`. The serde tag `#[serde(tag = "code", rename_all = "snake_case")]` produces `{"code":"auth"}`, `{"code":"rate_limit","retry_after_s":42}` etc. — clean and consistent with the spec's `error.code` shape. - -## Issue #155 — MAXIMUS_API_URL env var in tests (MEDIUM) -`std::env::set_var` is deprecated as unsafe in Rust 1.81+ due to multi-threading concerns. However, the tests use `#[tokio::test]` (each runs in isolation) and the set_var call happens before any HTTP client is built, so the race window is practically zero. The alternative `mockito::Server::new_async()` returns a URL we need to inject; the simplest approach is env var override. We use `unsafe { std::env::set_var(...) }` with an explicit comment explaining the safety rationale. This matches common practice in Rust integration tests with mockito.