0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/frontend
Régis Hanol 8ba7a6448b
FIX: Trailing small actions could appear perpetually unread
Excluding small actions from a topic's counters (#40481) also excluded them
from `highest_post_number` / `highest_staff_post_number`, which are the ceiling
that `topic_users.last_read_post_number` is clamped to. As a result, a topic
whose last post is a small action (a close, pin, archive, etc. notice) could
never be read past that notice: the "last visit" line stayed above it on every
visit and the topic never read as fully caught up
(https://meta.discourse.org/t/-/404058).

The root cause is that `highest_post_number` quietly served two roles — the
highest post worth *notifying* about, and the highest post a user can *see*
(the read-position ceiling). Those were only ever the same value because small
actions used to count toward both. Dropping them from the columns is correct
for the first role but wrong for the second: small actions are visible to
everyone and occupy real stream positions that get read.

This keeps the columns meaning "highest notify-worthy post" — so `/unread`, the
unread badge, and watched notifications stay correct and cheap — and derives
"highest post in the visible stream" wherever a read position is written. That
value includes small actions (and whispers only for whisperers) and lives in
`Topic.highest_post_number_in_stream`; every read-tracking path now goes through
it: recording timings, the `last_read` clamp, `reset_highest`, `dismiss_posts`,
the close/auto-close `pretend_read` target, nested-topic catch-up, and the
post-merge caught-up detection.

Because `last_read_post_number` can now legitimately exceed the notify counter,
a few checks that assumed the two were equal became `>=` (the private-message
read indicator, the topic model's `visited` / `canClearPin`, and the client-side
tracking state).

Finally, `process_timings` computes the visible-stream ceiling once and threads
it into `update_last_read`, so the clamp no longer re-derives it and the hottest
read path stays a single index-backed `MAX(post_number)`.
2026-07-16 09:52:34 +02:00
..
asset-processor DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
deprecation-silencer
discourse FIX: Trailing small actions could appear perpetually unread 2026-07-16 09:52:34 +02:00
discourse-i18n DEV: add typescript support for core, themes and plugins (#41478) 2026-07-08 12:57:18 +01:00
discourse-markdown-it DEV: Bump eslint/lint-configs, and correct violations (#41321) 2026-07-01 10:39:57 +01:00
discourse-types DEV: Use bundler module resolution for @discourse/types consumers (#41661) 2026-07-13 21:43:39 -03:00
pretty-text DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
.npmrc
polyfills.js