Skip to content

[ENG-6292] Fixed stale registration moderation state race condition - #11852

Open
ihorsokhanexoft wants to merge 2 commits into
CenterForOpenScience:feature/pbs-26-15from
ihorsokhanexoft:fix/ENG-6292
Open

[ENG-6292] Fixed stale registration moderation state race condition#11852
ihorsokhanexoft wants to merge 2 commits into
CenterForOpenScience:feature/pbs-26-15from
ihorsokhanexoft:fix/ENG-6292

Conversation

@ihorsokhanexoft

@ihorsokhanexoft ihorsokhanexoft commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Ticket

https://openscience.atlassian.net/browse/ENG-6292

Purpose

When a registration is approved by an admin, postcommit spam checks are run with a stale state of a registration. While admin is being updated a registration moderation state to ACCEPTED, postcommit spam checks process a stale version of the registration that has moderation_state=INITIAL. So if postcommit finishes execution after transaction handlers, it overrides already updated ACCEPTED value by the stale INITIAL state

If we revert .save logic in tasks.py, the new test starts failing as moderation state is updated to INITIAL because by default .save updates all fields

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