Commit 42e35cb
CardDb: make loadCard idempotent (fix latent duplicate-PaperCard bug)
loadCard is not idempotent: addSetCard unconditionally increments the art index
and appends a fresh PaperCard, so a redundant call for a (name, set) printing
already loaded duplicates it in allCardsByName. Skip when that exact (name, set)
printing already exists. Guarding on card-name presence alone would break the
"add a printing from a not-yet-loaded set" path (StaticData.getOrLoadCommonCard),
where the card can exist under other sets while the requested set's printing is
still missing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGBC7aB5gagjvXk9qCgC2d1 parent 926eebe commit 42e35cb
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
448 | 454 | | |
449 | 455 | | |
450 | 456 | | |
| |||
462 | 468 | | |
463 | 469 | | |
464 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
465 | 483 | | |
466 | 484 | | |
467 | 485 | | |
| |||
0 commit comments