discourse/spec
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
..
fabricators DEV: Use UploadReference instead of ChatUpload in chat (#19947) 2023-01-24 13:28:21 +10:00
fixtures DEV: declare post position as simple number in structured data (#16231) 2023-01-30 08:07:04 +01:00
helpers FEATURE: Show more context in Discourse topic oneboxes 2023-01-11 14:22:53 +01:00
import_export DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
initializers DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
integration SECURITY: Default tags to show count of topics in unrestricted categories (#19916) 2023-01-20 09:50:24 +08:00
integrity FIX: Fix incorrect hashtag setting migration (#19857) 2023-01-16 10:53:00 +10:00
jobs DEV: extract anniversary badge query (#19716) 2023-01-16 11:55:00 +01:00
lib DEV: Add validator for search_ranking_weights site setting (#20088) 2023-02-01 06:43:41 +08:00
mailers DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
models Revert "DEV: Delete dead Topic#incoming_email_addresses code (#19970)" (#20037) 2023-01-27 11:27:15 +10:00
multisite DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
requests FIX: Allow non-persisted color-scheme colors to be edited (#20104) 2023-01-31 17:10:32 +00:00
script/import_scripts DEV: Add a test for create_post in import scripts (#18893) 2023-01-31 11:10:06 +01:00
serializers DEV: Improve MessageBus subscriptions for TopicTrackingState (#19767) 2023-02-01 07:18:45 +08:00
services FIX: Category permission change not creating a log (#20027) 2023-01-31 10:15:17 -03:00
support FEATURE: Allow changing slug on create channel (#19928) 2023-01-23 14:48:33 +10:00
system DEV: skip failing spec (#20095) 2023-01-31 10:58:50 +01:00
tasks FEATURE: Add rake task to mark old hashtag format for rebake (#19876) 2023-01-18 10:16:05 +10:00
views DEV: use structured data in crawler-linkback-list for referencing only (#16237) 2023-01-30 08:26:55 +01:00
rails_helper.rb DEV: Patch capybara to ignore client-triggered errors (#19972) 2023-01-24 11:07:29 +00:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00