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

Wait for transaction to complete before calling webhooks #2675

Merged

Conversation

kelvin-muchiri
Copy link
Contributor

Changes / Features implemented

Wait for transaction to complete before calling webhooks

fix exception AttributeError: 'ParsedInstance' object has no attribute 'xform'
@kelvin-muchiri kelvin-muchiri merged commit 8bda254 into bug-restservice-stale-data Aug 23, 2024
5 checks passed
@kelvin-muchiri kelvin-muchiri deleted the bug-restservice-stale-data-v2 branch August 23, 2024 10:32
kelvin-muchiri added a commit that referenced this pull request Aug 23, 2024
* fix stale data sent to rest services when editing submission

The data sent to rest services can be stale if the instance is not yet saved to the database when a submission is edited

* pin to master

* add comment

* fix typo in comment

* Wait for transaction to complete before calling webhooks (#2675)

* wait for transaction to complete before calling webhooks

* refactor code

* refactor code

* fix exception

fix exception AttributeError: 'ParsedInstance' object has no attribute 'xform'

* fix failing tests

capture on commit callbacks

* move misplaced comment

* use master database when calling external services

Call webhooks is a second-effect of creating/updating a submission. The operation should be pinned to master database, so that the replicas can be used by the clients reading from the API

* fix failing tests

* fix failing tests
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