20-06-2023 - Version 4.3.4 - Revert "FIX: Don't error when trying to write a message to a closed client (#336)". This seems to have broken MessageBus in production so reverting for now. 19-06-2023 - Version 4.3.3 - FIX: Use lowercase header names in `MessageBus::Rack::Middleware` for compatibility with Rack 3.x. - FIX: Don't error when trying to write a message to a closed client 13-01-2023 - Version 4.3.2 - FIX: Do not disable chunking on cancel/error 06-01-2023 - Version 4.2.1 - FIX: Ensure non-long-polling requests are always spaced out 04-11-2022 - Version 4.2.0 - FIX: Add redis gem version 5 support - FEATURE: Allow disabling subscriptions without disabling publication 22-02-2022 - Version 4.2.0 - FEATURE: Add support for `clear_every` parameter in Redis backend This allows the clearing of the backlog to take place once every N messages. In high-load scenarios, this can provide significant performance benefit. 16-02-2022 - Version 4.1.0 - PERF: Optimize Client#backlog for up-to-date clients Also introduces a new MessageBus#last_ids(\*channels) api for fetching the last_ids of multiple channels simultaneously 11-01-2022 - Version 4.0.0 - DEV: Remove backend diagnostics - DEV: Rename reliable_pub_sub to backend_instance - FIX: `destroy` following `after_fork` could thread lock 31-12-2021 - Version 3.4.0 - FEATURE: Remove process auto-termination on missed keepalives 20-12-2021 - Version 3.3.8 - FIX: Restore dist js files to fix a regression in 3.3.7 - FIX: Stop various thread/pg connection leaks - DEV: Fix ruby warnings 15-12-2021 - Version 3.3.7 - FIX: Prevent simple polling from clobbering the session - SECURITY: Fix path traversal on diagnostics route. 31-05-2021 - Version 3.3.6 - FEATURE: Introduce support for transport codecs - FIX: event subscription leak in JS after start/stop/start sequence - FEATURE: MessageBus.onVisibilityChange() can be used to trigger a visibility change check by hand 28-04-2021 - Version 3.3.5 - PERF: Optimised CORS preflight handling - FEATURE: Enable CORS preflight caching - FEATURE: Removed trailing cache buster from message bus polls - PERF: Improved delay poll timeout for cases where a tab moves in and out of the background 02-10-2020 - Version 3.3.4 - FIX: Remove trailing comma incorrectly added in ec60d8865. 18-09-2020 - Version 3.3.3 - FIX: `queue_in_memory` option not being passed to the backends. - FIX: `MessageBus::DistributedCache#publish` should raise on error. On the redis backend, any errors encountered during `MessageBus#publish` will add the message into an in memory queue and silently swallow the error. While this is behavior is OK for normal message_bus usage, it may lead to inconsistency when using `DistributedCache`. If a process doesn't publish successfully to another process, it will still update its in memory cache leaving the other processes unaware. As such, the distributed cache is out of sync and will require another successful write to the cache to resync all the caches. 15-09-2020 - Version 3.3.2 - FIX: In the JavaScript client throw when when lastId is given but is not a number. - FEATURE: raise when attempting to publish to invalid targets - Log when DistributedCache encounters an error when publishing. 09-06-2020 - Version 3.3.1 - FIX: Disconnect Redis conn when rescuing errors in global subscribe. - FIX: `MessageBus::Backends::Redis#global_subscribe` not closing Redis connections. 15-05-2020 - Version 3.3.0 - FEATURE: `MessageBus.base_route=` to alter the route that message bus will listen on. 07-05-2020 - Version 3.2.0 - FIX: compatibility with Rails 6.0.3, note: apps without ActionDispatch::Flash may stop working after this upgrade to correct this disable middleware injection with `config.skip_message_bus_middleware = true` and configure middleware by hand with `app.middleware.use(MessageBus::Rack::Middleware)` 28-04-2020 - Version 3.1.0 - FEATURE: `MessageBus#register_client_message_filter` to register a custom filter so that messages can be inspected and filtered away from clients. 27-04-2020 - Version 3.0.0 - Drop support for Ruby 2.3 - FIX: Don't publish message to intersection of `user_ids` and `group_ids` - instead use the union, this is a behavior change, hence a new major release. 26-03-2020 - Version 2.2.4 - FEATURE: shouldLongPollCallback optional setting which allows overriding decision about long polling 18-10-2019 - Version 2.2.3 - FIX: Protect redis config from being manipulated in backend 09-08-2019 - Version 2.2.2 - FEATURE: Support rate limiting by server, 429 status codes are respected and we hold off as needed - FIX: In the redis backend make the `is_readonly?` method compatible with the redis gem both pre and post v4.0 when the `client` attribute was removed 30-04-2019 - Version 2.2.1 - FIX: No longer handles exceptions raised in downstream middleware via `on_middleware_error` 28-01-2019 - Version 2.2.0 - FIX: Ruby HTTP Client not backing off polling on error. 11-12-2018 - Version 2.2.0.pre.2 - FEATURE: Re-wrote diagnostics UI using React - FEATURE: MessageBus HTTP Ruby Client 30-11-2018 - Version 2.2.0.pre.1 - FIX: diagnostics stopped working cause a private method was invoked on self 30-11-2018 - Version 2.2.0.pre - FIX: In redis backend we now expire the key used to track channel id this can cause a redis key leak with large amounts of subscriptions that go away - FEATURE: Much extra implementation documentation, and some improvements to usage documentation. - FEATURE: Improvements to development workflow: - Fully docker-based development and testing, with no other dependencies. - More stringent Rubocop enforcement and greater compliance. - Testing supported Ruby versions - Better test coverage of some features - Improved testing and assertion of the differences between backends - More stable tests - now pass pretty much every run - Documentation syntax is verified as part of testing - FEATURE: Ruby 2.2.0 is no longer supported as it is EOL - FEATURE: Better feature parity between backends: - Adds support for backlog expiry to memory backend - Support setting backlog expiry on publication w/ Postgres - Supports setting backlog size on publication for memory/postgres - FEATURE: `MessageBus.off` now prevents the server subscription from starting up. - FEATURE: Trims unused parts of the public API: - Methods removed: - ConnectionManager#stats (never used and the ConnectionManager is not exposed to application code) - Client#cancel (effectively duplicate of Client#close and the Client is only available via the ConnectionManager, thus not available to application code) - Methods made private: - MessageBus::Implementation#encode_channel_name - MessageBus::Implementation#decode_channel_name - Client#in_async? - Client#ensure_closed! - ConnectionManager#subscribe_client - Diagnostics.full_process_path - Diagnostics.hostname - MessageBus::Rack::Diagnostics#js_asset - MessageBus::Rack::Diagnostics#generate_script_tag - MessageBus::Rack::Diagnostics#file_hash - MessageBus::Rack::Diagnostics#asset_contents - MessageBus::Rack::Diagnostics#asset_path - MessageBus::Rack::Diagnostics#index - MessageBus::Rack::Diagnostics#translate_handlebars - MessageBus::Rack::Diagnostics#indent - MessageBus::Rack::Middleware#start_listener - MessageBus::Rack::Middleware#close_db_connection! - MessageBus::Rack::Middleware#add_client_with_timeout - Methods switched from protected to private: - MessageBus::Implementation#global? - MessageBus::Implementation#decode_message! - MessageBus::Implementation#replay_backlog - MessageBus::Implementation#subscribe_impl - MessageBus::Implementation#unsubscribe_impl - MessageBus::Implementation#ensure_subscriber_thread - MessageBus::Implementation#new_subscriber_thread - MessageBus::Implementation#global_subscribe_thread - MessageBus::Implementation#multi_each - Client#write_headers - Client#write_chunk - Client#write_and_close - Client#messages_to_json 15-10-2018 - Version 2.1.6 - FEATURE: `MessageBus.publish` accepts option `site_id` to publish to a site - FEATURE: Added MessageBus::DistributedCache for cross process caching - PERF: Use monotonic times in timer thread - FEATURE: min poll interval is now configurable client side 16-05-2018 - Version 2.1.5 - FIX: In some cases a 30 second initial delay could happen cause client lost info about long poller 20-04-2018 - Version 2.1.4 - FIX: Subtle issue where poll timeout may not be cleared causing multiple concurrent polls - FIX: Add extra protection for poller to ensure there is never a case where multiple ajax happens concurrently 09-01-2018 - Version 2.1.2 - FEATURE: minHiddenPollInterval set to 1500ms out of the box, ensures we never do hidden tab polls at a high rate if tons of tabs are open - FEATURE: added random 500ms to delayed polls to increase tab entropy 18-12-2017 - Version 2.1.1 - FEATURE: allow setting of max_backlog_size and max_backlog_age on publish for redis provider 18-12-2017 - Version 2.1.0 - FEATURE: you can now lookup last N messages on channel on subscribe from JavaScript Subscribe at position (-1 - numberOfMessages) from the client 24-11-2017 - Version 2.0.9 - PERF: faster serialization of messages - FEATURE: on backend flush web clients will resume and continue to get all new messages 06-10-2017 - Version 2.0.8 - Fix: Make redis readonly detection more robust 02-10-2017 - Version 2.0.7 - Fix/Feature: use LUA script for publishing to bus, this eliminates a race condition and ensures that we are never stuck in a multi transaction by mistake 29-09-2017 - Version 2.0.6 - Fix: correct after_fork so it correctly disconnects redis - Fix: correct message_bus #destroy used in tests to clean up spec (deadlock) - Fix: deliver backlog unconditionally when polling (and not long polling) 16-08-2017 - Version 2.0.5 - Quick fix, build on earlier version of Ruby cause https://github.com/rubygems/rubygems/issues/1448 is still open - Version 2.0.3 - Fix: broken MessageBus.redis_config - Perf: publish status message for filtered messages - Perf: add frozen strings to save on memory - Feature: improved logging when messages are dropped - Fix: handle missing actiondispatch flash 25-08-2016 - Version 2.0.2 - Feature: Add on_middleware_error callback for remapping middleware errors to HTTP results 25-07-2016 - Feature: Add JavaScript MessageBus.status() function 21-06-2016 - Version 2.0.1 - Fix: build using old ruby cause new ruby breaks stuff @sam 21-06-2016 - Version 2.0.0 - Fix: forked process terminates parent more cleanly (does not kill -9 parent if already terminated) @uri - Fix: add async true explicitly on ajax reqs to ensure it always works even if disabled by globally @washu 11-05-2016 - Version 2.0.0.beta.11 - Fix: for https://github.com/rubygems/rubygems/issues/1448 which is still broken, build under Ruby 2.0 11-05-2016 - Version 2.0.0.beta.10 - Fix: for https://github.com/rubygems/rubygems/issues/1448 11-05-2016 - Version 2.0.0.beta.9 - Fix: requests without content type were erroring out, breaks CORS 27-04-2016 - Version 2.0.0.beta.8 - Fix: exception raised sometimes when subscribing at a particular position 26-04-2016 - Version 2.0.0.beta.7 - Feature: Support custom HTTP headers without depending on jQuery @nathanstitt - Feature: Allow subscribe at a particular position from server side @sam 29-02-2016 - Version 2.0.0.beta.6 - Feature: Support standalone operation without depending on jQuery @nathanstitt - Feature: Support a noconflict mode @nathanstitt - Feature: Support JSON POST payload @nathanstitt 29-02-2016 - Version 2.0.0.beta.5 - Feature: Memory backend @jeremyevans - Fix: JavaScript unsubscribe was not updating publicly visible MessageBus.callbacks @sam - Fix: When MessageBus is talking to a readonly redis buffering may cause a infinite loop @tgxworld - Version 2.0.0.beta.4 - Feature: allow verbose redis logging by specifying `enable_redis_logger` in config, default disabled - Version 2.0.0.beta.3 - Feature: Postgresql backend @jeremyevans - Breaking Change: Configuration API changed see Readme for details @jeremyevans - Breaking Change: Remove runtime dependency on Redis @jeremyevans - Dev: Convert all specs to minitest @jeremyevans - Feature: Support passing channels to Rack middleware via env['message_bus.channels'] via @jeremyevans 03-01-2016 - Version 2.0.0.beta.2 - Fix: Remove stray console.log - Version 2.0.0.beta.1 - Feature: add support for chunked encoding transport, this significnatlly improves long polling performance - Feature: strip around_filters and client filters, which were speculative - Fix: Message delivery race condition when a message was published just as long poll started. Ben Langfeld - Feature: strip support for message_handlers, speculative feature that was not used 09-12-2015 - Version 1.1.1 - Fix: In multisite config there was no way to specify site for last_id or backlog to resolve overrides were added to #last_id and #backlog, MessageBus::Client now uses the new overrides 07-12-2015 - Version 1.1.0 - Fix: keep track of client sequence on server, abandon old subscribes - Fix: rare concurrency issue when subscribing concurrently - Feature: remove most jQuery dependency from message-bus.js 09-07-2015 - Version 1.0.16 - Fix: correct edge cases around keepalive checks on bus 09-07-2015 - Version 1.0.15 - Feature: MessageBus.reliable_pub_sub.max_backlog_age (in secs) configurable (default to 7 days) - Fix: API for MessageBus.backlog("/bla") was returning global backlog by mistake - Change: Max global backlog size reduced to 2000 elements 08-06-2015 - Version 1.0.14 - Fix: we can not use Thread#kill best keepalive can do is terminate process cleanly - Feature: you can opt-out of keepalive with MessageBus.keepalive_timeout = 0 08-06-2015 - Version 1.0.13 - Fix: on global subscribe reconnect replay missed messages - Feature: keepalive tests for global subscribe, catches hung redis connections 28-05-2015 - Version 1.0.12 - Feature: Support client_id targeted message 06-05-2015 - Version 1.0.11 - Fix: race condition in TimerThread 01-05-2015 - Version: 1.0.10 - Feature: no longer depends on EventMachine (only used for Thin backend) - Feature: reliable pub sub will queue messages in memory if redis is readonly, configurable - Fix: if redis is flushed we will continue to deliver messages 23-03-2015 - Version 1.0.9 - Fix: inherit off StandardError not Exception for all exceptions raised 20-03-2015 - Version 1.0.8 - Fix: aggressive short polling in background 16-03-2015 - Version 1.0.7 - Feature: added pause and resume methods 03-02-2015 - Version 1.0.6 - Fix: global backlog not truncating correctly 23-09-2014 - Version 1.0.5 - Fix: missing custom headers from long polls 23-09-2014 - Version 1.0.4 - Change: MessageBus.access_control_allow_origin_lookup to extra_response_headers_lookup 23-09-2014 - Version 1.0.3 - Change: MessageBus.access_control_allow_origin to MessageBus.access_control_allow_origin_lookup 23-09-2014 - Version 1.0.2 - Feature: MessageBus.access_control_allow_origin to control origin header 23-09-2014 - Version 1.0.1 - Feature: $.ajax dependency can be passed in. - Feature: unsubscribe accepts a second param for the function to unsubscribe. 22-09-2014 - Version 1.0.0 - Feature: add backgroundCallbackInterval - interval to send polls when page is in the background - Feature: issue a long poll as soon as page moves into the foreground 11-08-2014 - Version 0.9.5 - Fix: release db connection a lot earlier for long polling (rails defer closes) 13-01-2014 - Version 0.9.4 - Added support for /global/ channel to publish messages across a multisite - Cleaned up test harness so it uses local bus as opposed to global - Fix bug where we could subscribe to a channel but miss starting messages - Added method for destroying a local MessageBus instance - ensure_reactor could say the reactor is running, but it was not, on first call 06-12-2013 - Version 0.9.3.2 - Fix permissions in gem 05-12-2013 - Version 0.9.3.1 - Add MessageBus.diagnostics() for diagnosing bus issues client side - Add more robustness to JavaScript, if callbacks used to fail they would halt the chain 03-12-2013 - Version 0.9.3 - Remove thin dependency - Improve robustness under failure conditions 30-09-2013 - Fix failures in Ruby 1.9 - Set up rack hijack by default in light of passengers new setting