Ticket #13803 (new Bug)
Opened 2 years ago
IIntIds and missed moved events
Reported by: | do3cc | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | Unknown | Version: | 4.2 |
Keywords: | Cc: |
Description
Somehow, IntIds manage to miss MoveEvents. Then you get a traceback like this:
File "home/starzel/.buildout/eggs/z3c.relationfield-0.6.2-py2.7.egg/z3c/relationfield/relation.py", line 28, in from_id
return intids.getId(self.from_object)
File "home/starzel/.buildout/eggs/five.intid-1.0.3-py2.7.egg/five/intid/intid.py", line 41, in getId
return z3IntIds.getId(self, ob)
File "home/starzel/.buildout/eggs/zope.intid-3.7.2-py2.7.egg/zope/intid/init.py", line 84, in getId
raise KeyError(ob)
This is what has happened: For a customer I had to move 4000 objects from folder a to folder b. I did this programatically with manage_XXX methods. The correct syntax I copied from plone.api:
https://github.com/plone/plone.api/blob/master/src/plone/api/content.py#L144
Days later I got sporadic tracebacks like the one above. The method that should have updated the IntId catalog is here: https://github.com/plone/five.intid/blob/master/five/intid/intid.py#L128 This handler contains a lot of shut up and continue exception handlers. Trying a copy&paste by hand confirmed that the handler gets called and is able to perform its duties. Throwing the events by hand also correctly updates the intids so that the errors disappear. Pseudeocode:
[notify(ObjectMovedEvent(x, orig_container, x.id, new_container, x.id)) for x in moved]
Unfortunately, this bug report does not contain enough inormation to find the issue, it serves more as a attempt to document the issue.