Skip to content

How to mitigate Model observation with save points is unsupported and will result in unexpected beauvoir. #113

Answered by hishnash
ranzbak asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

this some from here:

https://github.com/LostMoa/djangochannelsrestframework/blob/fbbdfcab72fe7d9a0954f9c3dce0094a702d7e01/djangochannelsrestframework/observer/model_observer.py#L105-L117

The reason the warning is raised is due to how I detect model changes for subscriptions. Im using the Django on_commit hook to defer sending the update over the channel group until after the commit has taken place. (otherwise we would send changes that might later be rolled back).

but the change on_commit hook as far as im aware is fired when nested transactional blocks complete (aka save points) this means that Django sends the on_commit event but the real transition has not completed, so the change …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SETTER2000
Comment options

Answer selected by ranzbak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants