jenkins-bot has submitted this change and it was merged. Change subject: ForeignNotifications::populate(): Fix max timestamp computation ......................................................................
ForeignNotifications::populate(): Fix max timestamp computation We weren't using the maximum timestamp, just the most recently encountered one. Change-Id: Ie1cfd8130ab0c5077c4b720101d214d33e3ea9b4 --- M includes/ForeignNotifications.php 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: Mooeypoo: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/ForeignNotifications.php b/includes/ForeignNotifications.php index b0081a8..d75fcba 100644 --- a/includes/ForeignNotifications.php +++ b/includes/ForeignNotifications.php @@ -116,7 +116,19 @@ if ( $data['count'] > 0 ) { $this->counts[$section] += $data['count']; $this->wikis[$section][] = $wiki; - $this->timestamps[$section] = new MWTimestamp( $data['ts'] ); + + $timestamp = new MWTimestamp( $data['ts'] ); + // We need $this->timestamp[$section] to be the max timestamp + // across all wikis. + // $timestamp < $this->timestamps[$section] = invert 0 + // $timestamp > $this->timestamps[$section] = invert 1 + if ( + $this->timestamps[$section] === false || + $timestamp->diff( $this->timestamps[$section] )->invert === 1 + ) { + $this->timestamps[$section] = new MWTimestamp( $data['ts'] ); + } + } } } -- To view, visit https://gerrit.wikimedia.org/r/273521 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1cfd8130ab0c5077c4b720101d214d33e3ea9b4 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Mooeypoo <mor...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits