Fix review issues in cookie pattern handling

- Fix DurationInput fallback unit from "minutes" to "seconds" and add
  seconds as a selectable unit to prevent silent duration inflation
- Use parseFloat instead of parseInt for duration input to preserve
  fractional values
- Scope prefix merge groups by category ID to prevent cross-category
  merging
- Relink cookies and delete exact patterns even when prefix pattern
  already exists
- Prefer exact matches and longest prefix in pattern selection query
- Fix wrong error type in GetCookiePattern (ErrCookiePatternNotFound)
- Handle singular/plural in humanizeSeconds fallback branch

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-30 10:26:25 +04:00
parent 5cdaddf8b1
commit 2fe77d9ddc
5 changed files with 91 additions and 22 deletions

View File

@@ -29,5 +29,5 @@ export function humanizeSeconds(seconds: number | null): string {
return `${count} ${count === 1 ? singular : plural}`;
}
}
return `${seconds} seconds`;
return `${seconds} ${seconds === 1 ? "second" : "seconds"}`;
}