Repository navigation
Fix CI type errors and the business-day off-by-one bug they were masking - #105
Merged
Merged
Conversation
…asking Type errors (all pre-existing, none introduced by the prior merge): - PropertyMap.tsx: MapLibre's GeolocateErrorEvent doesn't expose the PERMISSION_DENIED/POSITION_UNAVAILABLE/TIMEOUT constants that GeolocationPositionError does; compare err.code against the standard numeric codes (1/2/3) instead. - AdminPanel.tsx, PublicRecordsRequestPanel.tsx (x3), roundtrip.test.ts: `(await res.json()).error` / `.projectId` on an untyped Response now types as `unknown` rather than `any`; added explicit casts at each call site. - records-request.test.ts (x4): StageContext gained a required `actor` field that the test's hand-built context object never picked up. Added it once on the base object; the three spreads of it pick it up automatically. Real bug found by fixing the above: with type-check failing, CI's Unit tests step never ran, so a second, unrelated failure was hidden behind it — two failing assertions in statutes.test.ts. Root cause: businessDaysBetween() parsed "YYYY-MM-DD" dates (which `new Date(...)` treats as UTC midnight) and then read/advanced them with local-time `getDay()`/`setDate()`. On any server whose local timezone is behind UTC — most of the US — every date reads back as the previous local day, silently misclassifying weekdays as weekends and undercounting business days by up to one. This directly affects due-process deadline compliance checks, the thing this app exists to get right. Fixed by using getUTCDay()/setUTCDate() throughout, verified via the full test suite (324/324 passing) and a clean production build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type errors (fixes the red CI from #104)
All pre-existing, none introduced by that merge — confirmed by comparing against the identical error list from before it landed.
PropertyMap.tsx: MapLibre'sGeolocateErrorEventdoesn't expose thePERMISSION_DENIED/POSITION_UNAVAILABLE/TIMEOUTconstantsGeolocationPositionErrordoes — compareerr.codeagainst the standard numeric codes instead.AdminPanel.tsx,PublicRecordsRequestPanel.tsx(×3),roundtrip.test.ts:(await res.json()).error/.projectIdon an untypedResponsenow types asunknownrather thanany— added explicit casts at each call site.records-request.test.ts(×4):StageContextgained a requiredactorfield the test's hand-built context never picked up.Real bug this uncovered
With type-check failing, CI's Unit tests step never ran, hiding a second, unrelated failure: two failing assertions in
statutes.test.ts.Root cause:
businessDaysBetween()parsed"YYYY-MM-DD"dates (whichnew Date(...)treats as UTC midnight) and then read/advanced them with local-timegetDay()/setDate(). On any server whose local timezone is behind UTC — most of the US — every date reads back as the previous local day, silently misclassifying weekdays as weekends and undercounting business days by up to one. This directly affects due-process deadline compliance checks — the thing this app exists to get right.Fixed by using
getUTCDay()/setUTCDate()throughout.Verification
npx tsc --noEmit— clean, 0 errorsnpx vitest run— 324/324 passing (was 322/324 before the date-math fix)npm run build— clean production build🤖 Generated with Claude Code