Fixed Alerts page mark read/viewed alerted inconsistent with alerts pop-up

Xon

Well-known member
Affected version
2.2.1
The alerts page call flow is;
PHP:
        $alertRepo->addContentToAlerts($alerts);
        $alerts = $alerts->filterViewable();

        $skipMarkRead = $this->filter('skip_mark_read', 'bool');
        if ($page == 1 && $visitor->alerts_unviewed && !$skipMarkRead)
        {
            $alertRepo->autoMarkUserAlertsRead($alerts, $visitor);
            $alertRepo->markUserAlertsViewed($visitor);

            $this->markInaccessibleAlertsReadIfNeeded($alerts);
        }

But alerts pop-up is;
PHP:
        $alertRepo->addContentToAlerts($alerts);

        $this->markInaccessibleAlertsReadIfNeeded($alerts);

        $alerts = $alerts->filterViewable();

        $alertRepo->autoMarkUserAlertsRead($alerts, $visitor);

        if ($visitor->alerts_unviewed)
        {
            $alertRepo->markUserAlertsViewed($visitor);
        }

What I see as issues;
  • markInaccessibleAlertsReadIfNeeded is called after $alerts->filterViewable(); and autoMarkUserAlertsRead.
    This makes markInaccessibleAlertsReadIfNeeded abort early as all alerts are viewable and $hasInaccessibleUnread will never be set
  • Mark-as-read logic is gated behind alerts_unviewed checks (ie has unviewed, page count, etc)
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.3).

Change log:
Adjust some automatic alert read-marking behaviors
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom