Skip to content

fix: prevent replay of consumed verification values - #10

Merged
RohinBhargava merged 2 commits into
mainfrom
fix/consume-once-no-resurrection
Oct 14, 2026
Merged

RohinBhargava merged 2 commits into
mainfrom
fix/consume-once-no-resurrection

Conversation

@RohinBhargava

@RohinBhargava RohinBhargava commented Oct 14, 2026 •

Copy link
Copy Markdown

Consumed verification values can be reinserted when a transaction removes a managed entity from the identity map and a later parent-context write flushes it. This allows a consumed value to become usable again before expiry. Read the consumption snapshot with disableIdentityMap: true and remove unsetIdentity, while retaining the guarded delete and affected-row check.

Add PostgreSQL regression coverage for later writes, transaction/parent-context flushes, and two racing consumers; run it in the CI matrix. Include a patch changeset.

Validation: reproduced the transaction regression against unmodified source on MikroORM 7.1.8 and 7.2.1. Fixed PostgreSQL tests pass on both; full suite on 7.1.8 passes (114 passed, 36 skipped), and package build passes. Standalone test typechecking has a pre-existing cast error in the sealed-secret fixture.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 1d4624b0-787a-47b4-aa66-70268c2be82b
📥 Commits

Reviewing files that changed from the base of the PR and between 4107331 and abde984.

⛔ Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing: 5
  • .changeset/consume-without-resurrection.md
  • .github/workflows/ci.yaml
  • package.json
  • src/adapter.ts
  • tests/node/consumeOne.postgres.test.ts
 _______________________________________________________________________________________________________________________________________________________________
< English is just a programming language. Write documents as you would write code: honor the DRY principle, use metadata, MVC, automatic generation, and so on. >
 ---------------------------------------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@RohinBhargava
RohinBhargava merged commit dd436da into main Oct 14, 2026
6 checks 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.

1 participant