Skip to content

Fix API duplicate ID handling issue#3

Merged
terwey merged 2 commits intomainfrom
claude/fix-duplicate-id-parameter-01KyKx3UwiXP1RboAmH42eYT
Nov 15, 2025
Merged

Fix API duplicate ID handling issue#3
terwey merged 2 commits intomainfrom
claude/fix-duplicate-id-parameter-01KyKx3UwiXP1RboAmH42eYT

Conversation

@terwey
Copy link
Copy Markdown
Contributor

@terwey terwey commented Nov 15, 2025

Add a configuration flag to allow duplicate IDs when loading VCR cassettes. This addresses scenarios where implementers need to load cassettes with duplicate IDs without breaking the API.

Changes:

  • Added allowDuplicateIDs boolean field to TestServer struct
  • Added AllowDuplicateIDs(bool) method to enable/disable the flag
  • Updated duplicate ID validation in vcr.go to respect the flag
  • When flag is enabled, duplicate entries are skipped (existing preserved)
  • Added comprehensive test coverage for the new functionality
  • Updated Reset() to clear the flag

When AllowDuplicateIDs is set to true, loading VCR cassettes with duplicate bot/deal IDs will not return an error. Instead, duplicate entries are silently skipped, preserving the existing entries.

Add a configuration flag to allow duplicate IDs when loading VCR cassettes.
This addresses scenarios where implementers need to load cassettes with
duplicate IDs without breaking the API.

Changes:
- Added `allowDuplicateIDs` boolean field to TestServer struct
- Added `AllowDuplicateIDs(bool)` method to enable/disable the flag
- Updated duplicate ID validation in vcr.go to respect the flag
- When flag is enabled, duplicate entries are skipped (existing preserved)
- Added comprehensive test coverage for the new functionality
- Updated Reset() to clear the flag

When AllowDuplicateIDs is set to true, loading VCR cassettes with
duplicate bot/deal IDs will not return an error. Instead, duplicate
entries are silently skipped, preserving the existing entries.
@terwey terwey marked this pull request as ready for review November 15, 2025 22:19
@terwey terwey merged commit 561fbfb into main Nov 15, 2025
1 check passed
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.

2 participants