feat(core): merge reports in cli#2402
Conversation
Deploying midscene with
|
| Latest commit: |
b07ccb9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c31302e8.midscene.pages.dev |
| Branch Preview URL: | https://feat-merge-reports-in-cli.midscene.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc76da3fa9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if (!sessionName) { | ||
| return undefined; | ||
| } | ||
| return readCliReportSession(sessionName)?.reportFileName; |
There was a problem hiding this comment.
Prevent stale report session reuse across CLI runs
readCliReportFileName() always reuses the last persisted session when cli-report-session/<name>.json exists, so a later lazy command (for example after *_disconnect or from a fresh shell) can keep appending to an old report until another *_connect overwrites that file. This can silently merge unrelated devices/pages/runs into one artifact, which makes CLI report output misleading in stateless command workflows.
Useful? React with 👍 / 👎.
| } catch { | ||
| return undefined; |
There was a problem hiding this comment.
Throw on corrupted CLI report session data
The parser currently swallows JSON read/parse failures and returns undefined, so truncated or malformed session files fail open with no user-visible error. In that case report merging silently degrades (commands start using new default report names), which is hard to diagnose and violates the repository rule to throw when something goes wrong.
Useful? React with 👍 / 👎.
No description provided.