discourse/config/initializers
Martin Brennan fb4bd7951a
FIX: Add request tracking headers to Message Bus responses (#35537)
Previously, we didn't pass through the `X-Discourse-Trackview` and
`X-Discourse-Browserpageview` headers in the MessageBus `/poll`
response.
This is because MessageBus has a specific way of defining extra headers,
which we do in the `004-message_bus.rb` initializer.

We were adding the `X-Discourse-*` headers in `RequestTracker` after
`@app.call` was called, so the MessageBus middleware which is lower in
the
middleware stack would not have access to this data.

So in this commit, we hoist this data collection about the request
tracking above the `@app.call` line so it's acceessible in the
MessageBus middleware and we can add them to the response there. We
also move this data collection into a reusable method so we can call it
from before the env and also later when actually logging the request.

Followup 33abb858e9
2025-10-27 12:21:37 +10:00
..
000-active_record.rb DEV: Move 'unknown OID' embeddings fix into core (#35519) 2025-10-21 15:23:24 +01:00
000-development_reload_warnings.rb DEV: prevent files being watched warning when using devenv (#32690) 2025-05-13 11:09:53 +02:00
000-mini_sql.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
000-pg_connection_patch.rb DEV: Patch ActiveRecord's postgresql adapter .new_client (#33820) 2025-09-18 11:34:37 +08:00
000-post_migration.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
000-trace_pg_connections.rb DEV: Move debugging gem from byebug to debug (#34827) 2025-09-17 10:08:52 -03:00
000-zeitwerk.rb DEV: Add Pitchfork alongside Unicorn (#35370) 2025-10-24 11:08:23 +02:00
001-redis.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
002-freedom_patches.rb DEV: Migrate Sidekiq to a dedicated Redis DB 2025-03-03 15:42:26 +01:00
002-rails_failover.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
004-message_bus.rb FIX: Add request tracking headers to Message Bus responses (#35537) 2025-10-27 12:21:37 +10:00
005-site_settings.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
006-ensure_login_hint.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
006-mini_profiler.rb DEV: Upgrade the Redis gem to v5.4 2025-03-19 14:34:00 +01:00
008-rack-cors.rb DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
009-omniauth.rb FIX: Don’t store return path in the session 2025-09-19 10:05:20 +02:00
012-web_hook_events.rb FIX: Respect category/tag filtering for reviewable webhooks (#33051) 2025-06-04 10:42:23 +08:00
013-excon_defaults.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
014-track-setting-changes.rb DEV: Fix theme site setting flakiness part 2 (#33813) 2025-07-24 10:47:25 +10:00
099-anon-cache.rb FEATURE: Add experimental option for strict-dynamic CSP (#25664) 2024-02-16 11:16:54 +00:00
099-drain_pool.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
100-active-support-type-extensions.rb DEV: Move more service code to core (#26613) 2024-04-12 13:14:19 +02:00
100-custom-timezones.rb DEV: maps IST rails timezone to kolkata (#32896) 2025-05-26 08:56:04 +02:00
100-flags.rb DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
100-i18n.rb FIX: Purge ExtraLocalesController cache correctly for multisite (#32654) 2025-05-08 23:52:45 +01:00
100-logster.rb PERF: Don't do initialization for every DB if RAILS_DB is set (#28668) 2024-09-03 15:56:46 +10:00
100-oj.rb DEV: default Oj to compat mode 2020-01-16 07:52:28 +11:00
100-onebox_options.rb DEV: Add a user agent to all HTTP requests that Discourse makes. (#31555) 2025-03-03 16:32:25 +11:00
100-push-notifications.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
100-quiet_logger.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
100-regex-timeout.rb DEV: Introduce regex_timeout_seconds global setting (#20774) 2023-03-22 12:01:35 +00:00
100-secret_token.rb
100-session_store.rb DEV: allow developers to use HTTPS if they wish (#26384) 2024-03-27 10:48:04 +11:00
100-sidekiq.rb DEV: Configure skip_default_job_logging for Sidekiq take 2 (#34652) 2025-09-01 14:02:11 +08:00
100-silence_logger.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
100-strong_parameters.rb
100-verify_config.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
100-wrap_parameters.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
101-lograge.rb DEV: Fix lograg logger and log_level not following rails log_level (#33218) 2025-06-17 09:59:58 +08:00
102-truncate-logs.rb DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
200-first_middlewares.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
300-perf.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
400-deprecations.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
999-themes.rb DEV: Improve system theme loading (#34954) 2025-09-24 17:56:41 +01:00
assets.rb DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
filter_parameter_logging.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00