aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-04-06 16:54:29 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-04-06 17:42:23 +0100
commitfcc746e57616e34f370576abd1e614613c937b89 (patch)
treeb36f9dda08ac3f73176081cfbefb6a8012203220
parent149907dc7518957534ac207f677dc4caad1fe1ea (diff)
Allow same-time state change from Open311 updates.
If we've pulled in a report and an update from an external source, both may have exactly the same timestamp, and we do want to record the problem_state in that case.
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index 661b039b0..cee1a629f 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -141,7 +141,8 @@ sub update_comments {
# if the comment is older than the last update
# do not change the status of the problem as it's
# tricky to determine the right thing to do.
- if ( $comment->created > $p->lastupdate ) {
+ # Allow the same time in case report/update created at same time (in external system)
+ if ( $comment->created >= $p->lastupdate ) {
# don't update state unless it's an allowed state and it's
# actually changing the state of the problem
if ( FixMyStreet::DB::Result::Problem->visible_states()->{$state} && $p->state ne $state &&