Action triggers repeat_delay looking at unrelated events
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
3.6 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Tested in Evergreen 3.1
I'm seeing events blocked from being created if there is a repeat_delay but a different event falls into that window and the events share the same target ID.
I've been testing with the Expiration Courtesy Notices.
event def 110
Hook au.expired (or expired on early setups)
repeat_delay 300 days
This should fire off if there no no 110 events in the last 300 days, and there isn't.
However, there is a single event from 3 months ago for a different trigger,
event def 32
hook biblio.
So it looks like Evergreen needs to not just find events with a matching target, but also limit them to the event definition as well.
It looks like it only cares about the target value,
open-ils.
Changed in evergreen: | |
importance: | Undecided → Medium |
milestone: | none → 3.4.3 |
Changed in evergreen: | |
milestone: | 3.4.3 → 3.4.4 |
Changed in evergreen: | |
milestone: | 3.4.4 → 3.5.1 |
Changed in evergreen: | |
milestone: | 3.5.1 → 3.5.2 |
Changed in evergreen: | |
milestone: | 3.5.2 → 3.6.1 |
Changed in evergreen: | |
milestone: | 3.6.1 → 3.6.2 |
Changed in evergreen: | |
milestone: | 3.6.2 → 3.6.3 |
Changed in evergreen: | |
milestone: | 3.6.3 → 3.6.4 |
Changed in evergreen: | |
milestone: | 3.6.4 → 3.7.2 |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
This turns out to be a very straight-forward fix. Branch here:
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ miker/lp- 1823983- keep_event_ id_filter_ on_delay_ repeat_ check
From the commit message:
This bug has existed since the repeat_delay feature was added, but likely only rarely was triggered because most events don't have a repeat_delay, and those that do don't interact with the same target. However, as more repeatable event definitions are created, inappropriate interaction becomes more likely.
In this commit we avoid overwriting the whole join condition clause, which already contains an event definition id filter and needs to retain it.
Included is an unrelated change that uses the new-ish form of interval_to_seconds that avoids DST boundary shifting issues by passing a context DateTime object as the second parameter.