- mark_helped! gated broadcast on if save, but save returns false
when needs_help is already false (no dirty attributes in CouchDB)
- Same fix applied to remove_needs_payment!
- Broadcast is the important side effect — save is just persistence
- Log channel remapping and data on every broadcast
- Log warnings when channel format is unknown
- Helps trace whether broadcasts reach ActionCable.server
- Benjamin standardized on /user_123 in mozo.rb (underscore, no slash)
- Old remap regex ^/user/(.+)$ didn't match /user_123
- Fix: ^/user[/_](.+)$ accepts both separators → user_123
- MozoChannel < ApplicationCable::Channel was failing with
NameError: uninitialized constant ApplicationCable::Channel
- Standard Rails convention requires both connection.rb and channel.rb
- ActionCable::TaggedLoggerProxy crashes with NoMethodError when
logger is nil (common in apps upgraded from older Rails)
- Add after_initialize hook to guarantee ActionCable.server.config.logger
falls back to Rails.logger or
- Add Mozo::Counter::Redis with same get/set/incr/decr interface
- Add redis gem (~> 5.0) to Gemfile
- Update cable.yml to use Redis adapter in production (shared with counters)
- Document DrbCounter → Redis migration in broadcasting-migration.md
- Redis installed and running on vmi3300327
- Leave Faye as current broadcaster; both switches are one-line changes
DrbCounter problems solved:
- In-memory → persistent (RDB + AOF)
- Single-process DRb → multi-process safe Redis
- Atomic INCR/DECR across Puma workers
- One less custom process to manage
- include Broadcastable in app/models/list.rb
- include Broadcastable in app/models/order.rb
- Remove config/initializers/model_broadcast.rb (ApplicationController.new anti-pattern)
- Broadcasting now goes through Mozo.broadcast_* directly, not via controller hack