Commit Graph

8 Commits

Author SHA1 Message Date
BenClaw eef3d17431 feat(counter): add Mozo::Counter.provision! to seed Redis from CouchDB
- Reads Order.by_supplier_id_and_state view (reduce, grouped)
- Sets Redis keys: supplier_counter:<id>:orders_placed / orders_in_process
- Creates design doc if missing (from drb_counter/couchdb_design.yml)
- Rake task: rails counters:provision
- Also invokable directly: rails runner 'Mozo::Counter.provision!'
2026-05-17 22:02:56 +02:00
BenClaw bdd1d248db debug(action_cable): add server-side broadcast logging
- Log channel remapping and data on every broadcast
- Log warnings when channel format is unknown
- Helps trace whether broadcasts reach ActionCable.server
2026-05-17 19:41:00 +02:00
BenClaw 7c69f0a0bc fix(action_cable): accept both /user/123 and /user_123 channel formats
- 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
2026-05-17 19:27:30 +02:00
bterkuile 12836dd14b Switch to Redis counter 2026-05-17 10:48:05 -05:00
BenClaw 3e4bcc80c8 feat(counter): add Redis counter adapter, replace DrbCounter
- 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
2026-05-17 16:42:09 +02:00
root 1f52448253 feat(broadcasting): add ActionCable adapter + fix model broadcast anti-pattern
- Add Mozo::Broadcaster::ActionCable as drop-in Faye replacement
- Fix model_broadcast.rb: delegate to Mozo directly instead of
  ApplicationController.new (memory-unsafe anti-pattern)
- Add Broadcastable concern for clean model-side broadcasting
- ActionCable config: async adapter, cable.yml, WebSocket endpoint
- MozoChannel with per-entity authorization (user/supplier/employee)
- Connection auth via auth_token (matches existing auth pattern)
- Mount /cable WebSocket in routes
- Add broadcasting-migration.md with Faye→ActionCable guide
2026-05-17 15:25:49 +02:00
bterkuile 63b19cb78a Infrastructure and add removeListNeedsHelp to users 2026-02-09 17:56:05 -05:00
bterkuile 0e051b1f93 rename qwaiter to mozo 2025-09-20 17:35:58 -05:00