0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/spec
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
..
db FIX: Prevent backslash accumulation in upload markdown labels (#39461) 2026-06-03 18:10:38 +02:00
fabricators FEATURE: Show bounce rate and average session duration on the dashboard (#40936) 2026-07-03 10:49:32 +08:00
fixtures DEV: Allow plugins to register admin-panel-specific CSS (#40345) 2026-05-28 11:03:38 +01:00
generator DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
helpers SECURITY: Bind shared session key to auth token and enforce user gates (#41610) 2026-07-14 13:25:05 +08:00
import_export
initializers SECURITY: Harden imagemagick execution 2026-06-30 16:10:52 +02:00
integration FIX: store method in route matcher (#41512) 2026-07-07 11:49:56 -04:00
integrity DEV: add upcoming change permanent banner metadata (#41700) 2026-07-15 11:20:02 +04:00
jobs FEATURE: Support users in DAccessControl and backend (#41358) 2026-07-15 09:18:06 +10:00
lib FIX: Trailing small actions could appear perpetually unread 2026-07-16 09:52:34 +02:00
mailers FIX: allow custom email sender name via translation overrides (#40674) 2026-06-09 14:03:03 +04:00
migrations FIX: Ensure each flag gets a unique name_key (#40899) 2026-06-24 16:37:59 +02:00
models FIX: Trailing small actions could appear perpetually unread 2026-07-16 09:52:34 +02:00
multisite DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
queries/reports FEATURE: Change default upcoming change promotion status to Beta (#41275) 2026-07-06 09:13:37 +10:00
requests FIX: Trailing small actions could appear perpetually unread 2026-07-16 09:52:34 +02:00
script DEV: Automatic upcoming change status report and PR creation (#40291) 2026-06-11 15:19:15 +10:00
serializers FEATURE: Category management UI for admins (#41218) 2026-07-15 09:17:25 +10:00
services FIX: Trailing small actions could appear perpetually unread 2026-07-16 09:52:34 +02:00
support DEV: Use none persistent sessions in system tests (#41685) 2026-07-14 06:44:47 +08:00
system DEV: add upcoming change permanent banner metadata (#41700) 2026-07-15 11:20:02 +04:00
tasks DEV: set enable_gifs to true in migrate gifs rake task (#41502) 2026-07-07 17:04:28 +04:00
views
rails_helper.rb DEV: Block external requests in system specs via Chrome DNS resolver (#40685) 2026-06-17 12:29:57 +01:00
regenerate_swagger_docs
swagger_helper.rb