Fix runtime sidecar Day.js setup#467
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Fixes a runtime-sidecar crash during map completion by ensuring Day.js is configured within RunParser itself (instead of relying on main-process initialization), and adds a regression test to cover the inventory timestamp gate used by getItemStats.
Changes:
- Extend Day.js with
isSameOrAfterinsidesrc/main/modules/RunParser.tsso runtime-sidecar execution has the required plugin. - Add a unit test ensuring
RunParser.getItemStatscan compare timestamps and proceed to item stat generation without depending on main-process Day.js setup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/main/modules/RunParser.ts |
Registers the isSameOrAfter Day.js plugin locally so timestamp comparisons work in the runtime sidecar process. |
test/main/modules/RunParser.spec.ts |
Adds regression coverage for getItemStats timestamp gating and item stat generation path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
isSameOrAfterplugin insideRunParserRoot cause
RunParserrelied onsrc/main/index.tsto registerisSameOrAfter. Map processing now runs in a separate runtime-sidecar process, so that main-process Day.js configuration was never applied there. Completing a map therefore threwisSameOrAfter is not a functionbefore item stats could finish.Impact
Map completion in the runtime sidecar can proceed through inventory timestamp validation and finish counting the map.
Validation
npm run test:main -- test/main/modules/RunParser.spec.ts(16 tests passed)npm run typecheck:mainnpm run build:appgit diff --check