discourse/app
Alan Guo Xiang Tan 07ef828db9
DEV: Improve MessageBus subscriptions for TopicTrackingState (#19767)
## Why do we need this change? 

When loading the ember app, [MessageBus does not start polling immediately](f31f0b70f8/app/assets/javascripts/discourse/app/initializers/message-bus.js (L71-L81)) and instead waits for `document.readyState` to be `complete`. What this means is that if there are new messages being created while we have yet to start polling, those messages will not be received by the client.

With sidebar being the default navigation menu, the counts derived from `topic-tracking-state.js` on the client side is prominently displayed on every page. Therefore, we want to ensure that we are not dropping any messages on the channels that `topic-tracking-state.js` subscribes to.  

## What does this change do? 

This includes the `MessageBus.last_id`s for the MessageBus channels which `topic-tracking-state.js` subscribes to as part of the preloaded data when loading a page. The last ids are then used when we subscribe the MessageBus channels so that messages which are published before MessageBus starts polling will not be missed.

## Review Notes

1. See https://github.com/discourse/message_bus#client-support for documentation about subscribing from a given message id.
2023-02-01 07:18:45 +08:00
..
assets DEV: Improve MessageBus subscriptions for TopicTrackingState (#19767) 2023-02-01 07:18:45 +08:00
controllers DEV: Improve MessageBus subscriptions for TopicTrackingState (#19767) 2023-02-01 07:18:45 +08:00
helpers DEV: Prefer \A and \z over ^ and $ in regexes (#19936) 2023-01-20 12:52:49 -06:00
jobs DEV: Limit concurrency of NotifyReviewables job (#19968) 2023-01-25 15:19:11 -05:00
mailers DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
models DEV: Improve MessageBus subscriptions for TopicTrackingState (#19767) 2023-02-01 07:18:45 +08:00
serializers DEV: Improve MessageBus subscriptions for TopicTrackingState (#19767) 2023-02-01 07:18:45 +08:00
services FEATURE: allow restricting duplication in search index (#20062) 2023-01-31 12:41:31 +11:00
views DEV: use structured data in crawler-linkback-list for referencing only (#16237) 2023-01-30 08:26:55 +01:00