Skip to content

Commit

Permalink
When processing events with addTufoEvents, defer the autoadds until a…
Browse files Browse the repository at this point in the history
…fter the original nodes have been created. This addresses an issue where the autoadd'd events may have required props which are not included in autoadds.
  • Loading branch information
vEpiphyte committed Sep 12, 2017
1 parent fb99e81 commit beacb99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion synapse/cores/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,7 @@ def addTufoEvents(self, form, propss):

adds = []
rows = []
allfulls = []

for props in chunk:

Expand All @@ -1773,7 +1774,7 @@ def addTufoEvents(self, form, propss):
fulls['tufo:form'] = form

if self.autoadd:
self._runToAdd(fulls)
allfulls.append(fulls)

# fire these immediately since we need them to potentially fill
# in values before we generate rows for the new tufo
Expand All @@ -1799,6 +1800,10 @@ def addTufoEvents(self, form, propss):
xact.fire('node:add', form=form, valu=valu, node=node)
xact.spliced('node:add', form=form, valu=valu, props=props)

if self.autoadd:
for fulls in allfulls:
self._runToAdd(fulls)

return ret

def _reqProps(self, form, fulls):
Expand Down

0 comments on commit beacb99

Please sign in to comment.