Skip to content

Keep every raid kill awaiting a difficulty - #13

Merged
JDS300 merged 2 commits into
mainfrom
fix/keep-every-pending-raid-kill
Aug 14, 2026
Merged

Keep every raid kill awaiting a difficulty#13
JDS300 merged 2 commits into
mainfrom
fix/keep-every-pending-raid-kill

Conversation

@JDS300

@JDS300 JDS300 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Re-applies the multi-kill fix that was parked during the upstream sync (#12), now ported onto upstream's structure.

The bug

A single pending slot silently discarded the first kill when two raid targets died before a difficulty was confirmed — which is exactly when a raid confirms several at once. The second kill overwrote the first, and only the second was ever credited.

This is a cross-platform engine bug that predates the Linux branch, and upstream still has it. Worth sending them separately.

Why it needed porting rather than restoring

The original fix held a plain target -> seconds map. Upstream's itsspin#72 meanwhile extended the same single slot with the kill's occurred_at, zone, character and evidence, because a confirmation can arrive minutes after the kill, by which time the session has moved on.

Restoring the old map would have silently dropped that context. So the pending kills are now an ordered target -> PendingRaidKill map carrying all of it, and confirming a difficulty credits each waiting kill with its own context rather than whichever fight was current when the confirmation arrived.

Protocol compatibility

Insertion order keeps protocol v1 honest: pendingRaidTarget still names the first kill awaiting confirmation, exactly as before. pendingRaidTargets is added beside it, and the renderer pluralises only when there is more than one.

Verification

The test kills two raid targets ten minutes apart, confirms one difficulty, and asserts each is credited with its own kill time and evidence.

That test was verified to fail when the pending kills share one context — mutating the engine to the shared-slot behaviour makes Nagafen inherit Vox's kill time:

AssertionError: '2026-08-08T00:10:01Z' != '2026-08-08T00:00:01Z'

so the assertions detect the bug being fixed rather than passing vacuously.

  • Release quality gate: ALL PASS
  • test_desktop_worker: 26 passing
  • tsc --noEmit (renderer): clean

🤖 Generated with Claude Code

JDS300 and others added 2 commits August 14, 2026 09:01
A single pending slot silently discarded the first kill when two raid targets
died before a difficulty was confirmed, which is exactly when a raid confirms
several at once: the second kill overwrote the first, and only the second was
ever credited.

This fix existed on this fork before the upstream sync and was parked during
the PR itsspin#72 merge, because upstream had meanwhile extended the same slot with
the kill's occurred_at, zone, character and evidence. Reverting to the old
target -> seconds map would have dropped that context, so the kills are now
held as an ordered target -> PendingRaidKill map that carries all of it.
Confirming a difficulty credits every waiting kill with its own context, not
whichever fight happened to be current when the confirmation arrived.

The ordering keeps protocol v1 honest: pendingRaidTarget still names the first
kill still awaiting confirmation, exactly as it always did, and
pendingRaidTargets is added beside it for renderers that want the full list.

The test kills two raid targets ten minutes apart and asserts each is credited
with its own kill time and evidence. Verified to fail when the pending kills
share one context, which is the bug being fixed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The new test pinned both kill times as UTC strings, which only held in the
timezone it was written in: the log lines carry no zone, so the stored instant
follows whatever machine runs the suite. CI is UTC and this desktop is UTC-4,
so the runner read 20:00:01Z where the test expected 00:00:01Z.

It asserts the ten minutes between the two kills instead, which is the
property that actually distinguishes per-kill context from a shared slot and
holds in any zone. Verified passing under EDT, UTC and Asia/Tokyo, and still
failing when the pending kills share one context.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JDS300
JDS300 merged commit c2425ef into main Aug 14, 2026
6 checks passed
@JDS300
JDS300 deleted the fix/keep-every-pending-raid-kill branch August 14, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant