Summary
After upgrading from v10.9.1 to v11.7.1, reopening a channel after using
“Mark as Unread” restores the viewport to an older already-read post
instead of the unread post itself.
The unread state is preserved correctly (the “1 new message posted today”
banner appears), but the scroll restoration target is incorrect.
This behavior was not reported by our users on v10.9.1 and only began
after upgrading to v11.7.1.
Steps to reproduce
Environment
- Edition: Mattermost Team Edition (custom build)
- Server version: 11.7.1
- Previous version on same install: 10.9.1
- Client: Google Chrome on Windows
- Database:
PostgreSQL 13 → Amazon RDS PostgreSQL 16 during same upgrade - Search backend:
PostgreSQL FTS + pg_bigm - MM_FEATUREFLAGS_CJKSEARCH=true
- MM_SQLSETTINGS_QUERYTIMEOUT=120
Minimal deterministic repro
- Open a channel containing:
- at least one already-read post from a previous day
- at least one post from today
- Right-click today’s post and choose “Mark as Unread”.
- Confirm the banner appears at the top:
“↓ Jump to recent messages | 1 new message posted today”
This confirms the server correctly registered the unread state. - Switch to another channel via the sidebar.
- Reopen the original channel.
Expected behavior
The unread post should appear at (or very near) the top of the viewport,
directly below the “New Messages” separator, as in v10.9.1.
Observed behavior
The channel reopens scrolled to a previous-day already-read post.
In our recording:
- unread target post: today 13:23
- restored viewport position: yesterday 15:16
The unread banner remains visible at the top, but the actual unread post
is below the fold and requires manual scrolling to reach.
The issue only reproduces when the channel contains at least one unread
message. With zero unread messages, reopening behaves correctly.
Regression context
The previously closed #33536 (v10.10.x, fixed via MM-64957 in 10.10.2 /
10.11) covered a related but narrower auto-scroll regression in DMs.
The same symptom resurfacing in v11.x via the broader “open unread
channel” path may indicate either:
- the original fix was not carried into the v11 webapp /
virtualized post list changes, or - a new scroll restoration path reintroduced the same anchor
calculation issue.