Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algolia doesn't handle Django Atomic Transactions #278

Open
sameerkumar18 opened this issue Jan 12, 2019 · 3 comments
Open

Algolia doesn't handle Django Atomic Transactions #278

sameerkumar18 opened this issue Jan 12, 2019 · 3 comments

Comments

@sameerkumar18
Copy link

  • Django version: 2.0.6
  • Algolia Django integration version: 1.7.0
  • Language Version: Python 3.6.5

Consider - Auto-Index to be True

Description

While in a Django atomic transaction, if anytime save() is called - algolia is instantly updated. If due to some exception that atomic transaction fails, Algolia would still be updated with invalid values that do not match the database.

Steps To Reproduce

Step 1 - Import your model from app, import django transaction

>>> from myapp import mymodel
>>> from django import transaction

Step 2 - Start a transaction
// Consider there is boolean field status in model mymodel

>>> with transaction.atomic():
            obj = mymodel.objects.first()
            obj.status = False
            obj.save() # Algolia gets updated here
            raise Exception('something here') # This cancels/doesn't commit anything to the database
@nunomaduro
Copy link
Contributor

Thanks for bring this up to our attention, we will take a look soon as possible.

@sameerkumar18
Copy link
Author

Any update here @nunomaduro ?

@mohiuddin06617
Copy link

Any update on this issue @nunomaduro ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants