jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
MIT License
219 stars 30 forks source link

Switching rolled up parents resulting in duplicates on prior parent #599

Closed thomasadchapman closed 3 months ago

thomasadchapman commented 3 months ago

I've successfully duplicated this issue with a couple of different object scenarios, but not completely thoroughly.

I have a rollup from child to parent, all managed via flows calling CMDT, when a child is reparented, the correct value for the prior-parent is doubled - which points to regression, but I cannot see the triggering flow firing twice in debug. Flow setup:

image image image

with a simple CMDT record:

image

Manually recalculating the prior parent resolve the miscalculation

apex-07LTu000002YI3pMAG.log apex-07LTu000002YJK3MAO.log apex-07LTu000002YLNUMA4.log apex-07LTu000002YLNVMA4.log apex-07LTu000002YNNdMAO.log apex-07LTu000002YNNeMAO.log apex-07LTu000002YNPFMA4.log apex-07LTu000002YNQrMAO.log apex-07LTu000002YNSTMA4.log

jamessimone commented 3 months ago

@thomasadchapman I will take a look - thanks for submitting! I'll let you know if I have any questions

jamessimone commented 3 months ago

@thomasadchapman I'm noticing that your rollup version is several dozen behind the latest: you're running #460, and (notably), I can tell you that I added a test for this specific issue in #493 (ten versions past where you're at, but still far behind the present version). I'd recommend upgrading - it should fix your issue!

thomasadchapman commented 3 months ago

@jamessimone Well that's embarrassing! Problem resolved... Will endeavour to not be quite such an idiot in future.

jamessimone commented 3 months ago

Hey now, no worries! Glad to hear we're good - thanks again for submitting!