-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent Open311 updates from being sent out of order #5298
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5298 +/- ##
==========================================
+ Coverage 82.40% 82.42% +0.02%
==========================================
Files 415 415
Lines 32855 32864 +9
Branches 5270 5271 +1
==========================================
+ Hits 27074 27088 +14
+ Misses 4223 4218 -5
Partials 1558 1558 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think you can simplify the check for an earlier unprocessed comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, so just one more small further step - you can get rid of the order_by (as you don't care any more), I'd add an id => { "!=" => $comment->id }
to be on the safe side (not sure if there might be some rounding issues with the date formatting), add { rows => 1 }
as a second parameter to search() (because you only care about getting one result) and then add ->single
after the search, putting the result in a scalar, not an array (so you get that one result or undef). :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks :)
c10627f
to
97579a7
Compare
Updates are selected in random order but some cobrands/APIs (e.g. Northumberland/Alloy) do not know how to handle updates in order their end, so an earlier update may overwrite a later one.
This change checks that an update is not sent until earlier updates for that problem are sent.
Fixes https://github.com/mysociety/societyworks/issues/4640.
[skip changelog]