keystonejs / keystonejs/keystone

Transaction should prevent after operation hooks until committed

Open
#9,309 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10k
Forks
1.3k
Avg merge
19h 14m
Merged PRs (30d)
19

Description

* Create a transaction top update/create an item in a list which has afterOperation side effects causing action outside of transaction like queue postage label purchase based on order update
* rollback the transaction just before completion
* see the side effects still working while the actual transaction is rolled back

I should be seeing no `afterOperation` hook until the transaction is committed.

I believe this is debatable if the side effects should be allowed or not while transaction may be rolled back

Do we have a way to know if the `afterOperation` is running in transaction or not? at least I can try to defer the side effects somehow.

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction steps in the issue and trace how transactions invoke `afterOperation` hooks. Determine whether hooks can be deferred until commit and how rollback should affect them; done means side effects do not run before a successful commit, with behavior documented or covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.