Repository navigation
Fix Battle Log import attribution, counts and dialog races - #121
Conversation
Resolve winners against the recorded participants, keep usernames out of card evidence, preserve punctuation in actors, and count recorded turns and mulligan events consistently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Discard late parse, clipboard, and save responses after reset or unmount, and synchronously guard repeated save submissions. Exercise abandonment and concurrent submit behavior through the rendered dialog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73eaa74728
ℹ️ 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".
Matching the acting player at the start of a line dropped indented "- " / "• " detail lines, so Rare Candy evolutions and ability-driven attachments no longer counted towards deck identification. Strip the detail marker before matching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every keystroke invalidated the pending review request, but the auto-review effect only reschedules when the trimmed log changes. A trailing space or newline therefore discarded the pending review and auto-review silently stopped. Invalidate only when the trimmed log changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Result
Battle Log imports preserve the recorded player identities, winner and counts, and discard asynchronous work belonging to an abandoned dialog session. Parser-derived draft facts and the database save contract remain unchanged. No schema, Replay implementation, or stats implementation changes.
Bugs fixed
.; an unrecognized winner silently becomes a losslib/log-import/parser/stats.ts:121tests/log-import-player-identity.test.ts:11, participant-name variants, both perspectives, and unknown-winner rejectionlib/log-import/parser/players.ts:124,lib/log-import/parser/turns.ts:175Trainer[+]'s prize snapshotlib/log-import/parser/turns.ts:96,lib/log-import/parser/stats.ts:90-Trainer's recorded damage and prizeslib/log-import/parser/pokemon-mentions.ts:6TrainerversusOtherTrainerlib/log-import/parser/pokemon-mentions.ts:75DreepyversusCharizard, with independent expected card countslib/log-import/parser/stats.ts:185tests/local-e2e-battle-log-fixtures.test.ts:9uses James's real identified export and expects four turnsMath.maxlib/log-import/parser/stats.ts:275tests/log-import-stats.test.ts:33repeats the real appendix's mulligan event and excludes the opponent's bonus drawcomponents/ui/ImportLogDialog.tsx:226,components/ui/ImportLogDialog.tsx:523tests/import-log-dialog.test.ts:22resolves deferred responses after clear and closecomponents/ui/ImportLogDialog.tsx:344components/ui/ImportLogDialog.tsx:437components/ui/ImportLogDialog.tsx:454Each regression was observed red before retaining its corresponding fix. Player-name variants change only identities in the committed log fixture. Mulligan wording comes from the real PTCGL appendix. Existing damage scenarios retain their assertions. The only Replay test change is the importer summary expectation
totalTurns: 2→4; Replay behavior is unchanged.Suspected issues not fixed
resolveSelfOpponentcurrently selects the first accepted identity. A log containing both configured identities needs an explicit account-identity policy (prefer primary or reject ambiguity); the reviewed contract does not decide it. No speculative attribution rule was added.Validation and test consolidation
npm cicompleted.npm run lint,npm run typecheck, andnpm testpass.npm test: 327 cases, 326 passed, 1 skipped. Final: 327 cases, 326 passed, 1 skipped. Executed-case delta: 0.npx prettier --checkwas run for every changed file. The new rendered test andturns.tspass. Eight existing files retain their baseline formatting warnings; changed code was formatted without reformatting untouched code.git diff --checkpasses.🤖 Generated with Claude Code