You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on_created_tag is triggered during object upload only if object is new. If object upload was requested along with some new tags but object already exists, on_created_tag is not triggered for these new tags that are appended to the object.
Expected behaviour
on_created_tag should be triggered every time tag is added to the object.
Actually supported hook list is pretty broad but they're triggered only in oddly specific cases e.g. on_created_attribute is triggered only in attribute was added by calling POST /api/{type}/{hash}/attribute.
Current implementation is based on direct calls of hook dispatchers inside endpoint handling methods. I think better implementation would be a list of actions collected in e.g. g.request_actions. Every time we add tag using mwdb.model.object.Object.add_tag, proper actions are added to the queue.
Finally, actions are iterated using dedicated hook dispatcher method, where proper hooks are called depending on the action. Hook dispatcher method should be called at the end of the request handling, after transaction was committed. Failed hook call should not result in ISE 500 although proper error should be logged (non-fatal errors handling is also a problem there: #891)
The text was updated successfully, but these errors were encountered:
Environment information
/about
): v2.14.0pip install mwdb-core
)Behaviour the bug (what happened?)
on_created_tag
is triggered during object upload only if object is new. If object upload was requested along with some new tags but object already exists, on_created_tag is not triggered for these new tags that are appended to the object.Expected behaviour
on_created_tag
should be triggered every time tag is added to the object.Actually supported hook list is pretty broad but they're triggered only in oddly specific cases e.g. on_created_attribute is triggered only in attribute was added by calling
POST /api/{type}/{hash}/attribute
.Current implementation is based on direct calls of hook dispatchers inside endpoint handling methods. I think better implementation would be a list of actions collected in e.g.
g.request_actions
. Every time we add tag usingmwdb.model.object.Object.add_tag
, proper actions are added to the queue.Finally, actions are iterated using dedicated hook dispatcher method, where proper hooks are called depending on the action. Hook dispatcher method should be called at the end of the request handling, after transaction was committed. Failed hook call should not result in ISE 500 although proper error should be logged (non-fatal errors handling is also a problem there: #891)
The text was updated successfully, but these errors were encountered: