Skip to content

fix: validate workers parsed from qwdtt link - #39

Merged
luminescq merged 2 commits into
luminescq:mainfrom
timatigoogl3-code:fix/wdtt-workers-validation
Oct 5, 2026
Merged

luminescq merged 2 commits into
luminescq:mainfrom
timatigoogl3-code:fix/wdtt-workers-validation

Conversation

@timatigoogl3-code

Copy link
Copy Markdown
Contributor

Fix: workers from a qwdtt link was read via bare parseInt, so workers=abc produced NaN and workers=-5 / 9999 carried garbage into the slider power. This adds parseWorkers that only accepts an integer in 9-108 (4 hashes x 27) and returns undefined otherwise. No clamping, valid workers=18 path unchanged.

Tests: 3 new cases in frontend/src/__tests__/wdttLink.test.ts (abc, -5, 9999 -> undefined). npx vitest run src/__tests__/wdttLink.test.ts -> 18/18 pass, git diff --check clean.

@luminescq
luminescq merged commit ce5d05e into luminescq:main Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants