Skip to content

Commit

Permalink
Allow same-time state change from Open311 updates.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dracos committed Apr 6, 2018
1 parent 149907d commit fcc746e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion perllib/Open311/GetServiceRequestUpdates.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit fcc746e

Please sign in to comment.