Handlers registering + operator call + context view layer update

Hi,
we ve encountered a tiny annoying problem regarding the management at some point of uuids in our pipeline.

We have an operator that assigns a uuid to any transform/object and shape/geometry and material.
But this operator is being called inside a handler that is being registered whenever the depsgraph is updated.

Because whenever an operator is being called it is wrapped inside two calls to view_layer updates, those updates trigger again the handlers which, again, run the operator.
We have a cyclic call that can be managed and actually we are managing it.
For example, keeping track of the number of calls of the handlers for each depsgraph update.

Inspecting the code of the “ops.py” module, we realized that there is a protected method called _BpyOpsSubModOp._view_layer_update(context) at lines 126 and 135 and we were wondering if we could override this method so as to pass an argument which would indicate whether the handlers should be triggered or not.

But we cannot seem to find the python method and where it is located.
Or, is it just a binding to a C++ method and i should download blender’s source code?

Many thanks in advance!
Best regards from Spain,
JC

According to this: Running Operator inside bpy.app.handler causes infinite loop “using an operator inside a handler is not a good idea since operators are user level tools not a way of altering by code the scene”.

Just to let know that i followed Brecht’s advice about not using operators inside handlers, although we had it working correctly in the first place, we decided to avoid setting uuids with an operator.

Thanks!