Skip to content

fix(core): replace stale entry in RetrySubstore.upsert instead of pushing a duplicate (fixes #896) - #897

Open
meganemura wants to merge 1 commit into
allure-framework:mainfrom
meganemura:fix/retrysubstore-duplicate-retry
Open

meganemura wants to merge 1 commit into
allure-framework:mainfrom
meganemura:fix/retrysubstore-duplicate-retry

Conversation

@meganemura

@meganemura meganemura commented Aug 27, 2026 •

Copy link
Copy Markdown

Context

RetrySubstore.upsert (packages/core/src/store/retrySubstore.ts) always pushed the incoming TestResult onto the retryHash array without checking whether an entry with the same id already existed. When the same result id was upserted twice (see #896 for how this happens and a self-contained repro), the array ended up with two entries sharing one id — one stale, one fresh — and retriesByTr reported the test as having a retry of itself.

DefaultAllureStore already treats a re-visit of the same id as an update, not a new entry: #testResults.set(testResult.id, testResult) is a Map, so the same key replaces the old value. This PR makes RetrySubstore.upsert follow the same rule — if an entry with the same id is already in the array, replace it in place instead of pushing a duplicate.

Added a regression test that upserts the same id twice with a newer start and asserts retriesByTr no longer returns a duplicate.

Fixes #896

Checklist

@vdvukhzhilov
vdvukhzhilov force-pushed the fix/retrysubstore-duplicate-retry branch from d0f123f to ce32b9e Compare September 6, 2026 16:20
…hing a duplicate

Re-upserting the same test result id appended a second array entry
instead of replacing the first, so retriesByTr could list a test as
its own retry.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@meganemura
meganemura force-pushed the fix/retrysubstore-duplicate-retry branch from ce32b9e to 5e2bdb7 Compare September 16, 2026 11:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RetrySubstore.upsert appends a duplicate entry when the same result id is read twice

2 participants