Skip to content

Release 0.138.0#3300

Closed
odlbot wants to merge 10 commits intoreleasefrom
release-candidate
Closed

Release 0.138.0#3300
odlbot wants to merge 10 commits intoreleasefrom
release-candidate

Conversation

@odlbot
Copy link
Contributor

@odlbot odlbot commented Feb 17, 2026

cp-at-mit

annagav

Chris Chudzicki

renovate[bot]

pre-commit-ci[bot]

Dan Subak

dsubak and others added 10 commits February 12, 2026 09:02
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Nathan Levesque <nlevesq@mit.edu>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Levesque <nlevesq@mit.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@github-actions
Copy link

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:


## Changes for v1.yaml:


## Changes for v2.yaml:


Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Comment on lines +14 to +15
if created:
sync_hubspot_user(instance)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The post_save signal for syncing new users to Hubspot can trigger a race condition, as the Celery task is queued before the database transaction for the user is committed.
Severity: HIGH

Suggested Fix

Wrap the call to sync_hubspot_user(instance) within a transaction.on_commit() lambda. This will defer the execution of the Celery task until after the database transaction that creates the user has successfully committed, preventing the race condition.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: users/signals.py#L14-L15

Potential issue: The `post_save` signal handler `sync_user_to_hubspot_on_create` queues
a Celery task to sync a new user to Hubspot. This signal fires after the user object is
saved but before the database transaction is committed. This creates a race condition
where the Celery worker may try to fetch the user from the database before the record is
visible, causing the task to fail with an object-not-found error. This is a known
anti-pattern, and other signal handlers in the codebase, such as for products, correctly
use `transaction.on_commit()` to defer the task until after the transaction is complete.

Did we get this right? 👍 / 👎 to inform future reviews.

@rhysyngsun rhysyngsun closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants