Repository navigation
fix(app-shared): parse date-only strings as calendar days - #8181
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit adds the Assumptions: Files Reviewed (6 files)
Previous Review Summaries (2 snapshots, latest commit d8978a0)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d8978a0)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit resolves both prior findings: Files Reviewed (2 files in this increment)
Previous review (commit 07f807f)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe date-only parsing change is sound for the mobile surfaces that consume it, but the parser loses leading-zero years and the new timezone tests cannot prove that the zone stub actually applies. Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
No memory-leak risk introduced: the change adds no listeners, timers, subscriptions, or retained caches. Reviewed by deepseek-flash-latest · Input: 63.7K · Output: 9.9K · Cached: 590K Review guidance: REVIEW.md from base branch |
…dates # Conflicts: # apps/mobile/src/components/security-agent/audit-report-screen.tsx
|
bot: Android emulator run against the local dev stack. The Security Agent audit report renders its period with the UTC marker while the emulator clock is set outside UTC: the device reads Sat Oct 24 (+14), and the period end still renders 10/23/2026, the report's own calendar day. The generated stamp renders 10/23/2026, 10:39 PM UTC from the same run. Assertion from the accessibility dump captured with the screenshot: Single owned fake-account fixture, local Postgres and local Next.js; no production services in the path. |
|
bot: Android dev client from this branch against the local stack, signed in to a local test account, on the Security Agent audit report with one seeded finding and one event for that account. Two captures of the same view with the emulator clock set through two zones, taken after a relaunch in each. The visible lines were asserted from a Commands used, abbreviated: |
eshurakov
left a comment
There was a problem hiding this comment.
Shallow review: no critical issues found.
…dates # Conflicts: # packages/app-shared/src/utils.test.ts # packages/app-shared/src/utils.ts
|
bot: Verified on the Android dev client against the local dev stack at head The shared parser is covered by |







Evidence
Evidence: demonstrated — the Security Agent audit report ran inside the Android dev client against the local stack on this machine at this head and shows the backend's date-only period end as its calendar day, with the emulator clock west of UTC and again east of it. The shared parser itself was exercised by the package suite, which resolves a
YYYY-MM-DDvalue to that calendar day's local midnight inAmerica/Los_Angeles,Asia/Tokyo, andUTC.Change
packages/app-shared/src/utils.tsresolves aYYYY-MM-DDvalue to local midnight of that calendar day, so default local formatting shows that day. A date that does not exist in its month stays an invalidDate, so callers that check for one keep their fallback; four-digit years below 100 keep their year; a missing value stays an invalidDate.apps/mobile/src/components/security-agent/audit-report-screen.tsxformats the report's date-onlydisplayEndwith the existingformatCalendarDatehelper, so the header and the empty state show the report's calendar day, while generated and event clocks keepformatUtcTimestamp.packages/app-shared/src/utils.test.tscoversAmerica/Los_Angeles,Asia/Tokyo, andUTC, a day that does not exist in its month, a four-digit year below 100, a missing value, and timestamp instants.Verification
Supporting checks at head
007c37b:packages/app-shared,vitest run: 25 files, 530 tests passed;src/utils.test.ts: 8 tests passed.packages/app-shared,tsgo --noEmit: clean.apps/mobile,vitest run --project mobile-mounted src/components/security-agent/: 25 files, 299 tests passed.apps/mobile,tsgo --noEmit: clean.oxlinton the changed mobile files andoxfmt --checkon every changed file: clean.Android dev client against the local stack
Dev client
com.kilocode.kiloappon the emulator, Metro serving this checkout, Next.js onlocalhost:3000overadb reverse, signed in to the local dev stack. The backend answerssecurityAgent.getAuditReportwith a date-only period end:With the emulator clock west of UTC, where the local calendar date was still the previous day, the accessibility dump of the report header reads:
With the emulator clock east of UTC, where the local calendar date was already the next day, the same dump reads:
The date-only period end renders the report's calendar day in both device zones; the generated clock keeps its instant. The screenshot below is the eastern-zone capture of that screen.
Parser behavior in the package suite
The same parser is exercised under three time zone settings in
packages/app-shared/src/utils.test.ts, at the head that CI runs:Limitation: no product screen feeds a date-only backend value through the shared parser and then formats it in the device zone, so the parser's zone behavior is proven by the package suite rather than through a screen. The audit report carries the only date-only field on a mobile screen, and the device run above exercises that screen.
Production prerequisites
None.
Proxy answers
The owner's proxy gave these answers in the owner's place.
2026-09-26, what should the sharedparseTimestampreturn?Answer: Local-midnight calendar Date
Confidence: 0.75 · Precedent: Fix the root cause and the class of the issue: "fix class of issue preventing progress" (7f3470e0ba6f). The work item also asks for a local-midnight Date.
2026-02-30), what shouldparseTimestampdo?Answer: Preserve Invalid Date (Recommended)
Confidence: 0.80 · Precedent: Fix the root cause on every affected surface (session 7f3470e0ba6f: "fix class of issue preventing progress"). Keeping Invalid Date leaves existing caller fallbacks working and avoids silently showing the wrong day.