Skip to content
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

Only update 'lastupdate' when the update is new. #5350

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

neprune
Copy link
Contributor

@neprune neprune commented Jan 29, 2025

@neprune neprune marked this pull request as draft January 29, 2025 15:04
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.86%. Comparing base (fea0f9e) to head (64d267e).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5350      +/-   ##
==========================================
+ Coverage   82.44%   82.86%   +0.42%     
==========================================
  Files         416      416              
  Lines       32911    33812     +901     
  Branches     5286     5584     +298     
==========================================
+ Hits        27132    28017     +885     
- Misses       4217     4233      +16     
  Partials     1562     1562              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@neprune neprune force-pushed the fix-old-updates-applying-state branch from 3dd7a67 to 13176c8 Compare February 3, 2025 13:35
@neprune neprune changed the title Only update 'lastupdated' when the update is new. Only update 'lastupdate' when the update is new. Feb 3, 2025
@neprune neprune force-pushed the fix-old-updates-applying-state branch from 13176c8 to 4a71572 Compare February 3, 2025 13:37
@neprune neprune requested a review from dracos February 3, 2025 13:38
@neprune neprune marked this pull request as ready for review February 3, 2025 13:38
@neprune neprune removed the request for review from dracos February 3, 2025 13:49
@neprune neprune force-pushed the fix-old-updates-applying-state branch from 4a71572 to 64d267e Compare February 3, 2025 13:52
@neprune neprune requested a review from dracos February 3, 2025 14:06
@@ -281,7 +281,9 @@ sub _process_update {
# insertion. We also then need a clone, otherwise the setting of lastupdate
# will *also* reshift comment->created's time zone to TIME_ZONE.
my $created = $comment->created->set_time_zone(FixMyStreet->local_time_zone);
$p->lastupdate($created->clone);
if ($created > $p->lastupdate) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this works even given the time zone statement above, because both things by here should have a time zone for comparison purpose, I think.

@neprune neprune force-pushed the fix-old-updates-applying-state branch from 64d267e to 61e7964 Compare February 3, 2025 17:56
@neprune neprune merged commit 61e7964 into master Feb 3, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants