-
In my application, I noticed the warning: Model observation with save points is unsupported and will result in unexpected beauvoir. it originates from : djangochannelsrestframework/observer/model_observer.py:121 I looked around on Google, and in this project but there is no documentation on what causes this Warning. I know it results from transactions Django sets up in the database, but I have no clue about what causes those transactions to be problematic. Please advice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, this some from here: 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 could still be rolled back. I do want to do further investigation into Django code base to figure out if there is a way to filter out these on-commit calls to that I can correctly track changes from save-points (eg if a save point is reverted ignore its changes but keep others). |
Beta Was this translation helpful? Give feedback.
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 …