chore: minor cleanups — docs index, test-project fixture, empty catches, triage timestamp guard

- Add diagnostics.md and FN-4886/FN-5048 entries to docs/README.md index
- Fix test-project.test.ts spy target (updateSettings → init) to match fixture flow
- Remove unused DEFAULT_PROJECT_SETTINGS import and skip empty settings patch
- Add explanatory comments to empty catch blocks in secrets-env-writer
- Refine near-duplicate timestamp guard in triage for cleaner NaN handling
This commit is contained in:
gsxdsm
2026-05-19 14:22:11 -07:00
parent 587e9b416c
commit b7e57f84a9
5 changed files with 14 additions and 9 deletions

View File

@@ -136,7 +136,7 @@ describe("test-project fixture", () => {
const projectCountBefore = countTmpDirs(projectPrefix);
const globalCountBefore = countTmpDirs(globalPrefix);
const error = new Error("boom");
const spy = vi.spyOn(TaskStore.prototype, "updateSettings").mockRejectedValueOnce(error);
const spy = vi.spyOn(TaskStore.prototype, "init").mockRejectedValueOnce(error);
try {
await expect(

View File

@@ -5,7 +5,6 @@ import { isAbsolute, join } from "node:path";
import { TaskStore } from "../store.js";
import {
DEFAULT_PROJECT_SETTINGS,
GLOBAL_SETTINGS_KEYS,
type GlobalSettings,
type Settings,
@@ -42,7 +41,7 @@ function splitSettings(settings?: Partial<Settings>): {
projectPatch: Partial<Settings>;
} {
const globalPatch: Partial<GlobalSettings> = {};
const projectPatch: Partial<Settings> = { ...DEFAULT_PROJECT_SETTINGS };
const projectPatch: Partial<Settings> = {};
for (const [key, value] of Object.entries(settings ?? {})) {
if (isGlobalSettingsKey(key)) {
@@ -89,7 +88,9 @@ export async function createTestProject(
await store.init();
const { globalPatch, projectPatch } = splitSettings(options.settings);
await store.updateSettings(projectPatch);
if (Object.keys(projectPatch).length > 0) {
await store.updateSettings(projectPatch);
}
if (Object.keys(globalPatch).length > 0) {
await store.updateGlobalSettings(globalPatch);