iachat/enterprise/app/models/enterprise
Gabriel Jablonski 05e0d355dd
fix(captain): prevent clamp ArgumentError when captain limits are negative (#242)
When creating an inbox, `usage_limits` eagerly computes captain limits
even though only the `:inboxes` value is needed. If `total_count` in
`get_captain_limits` resolves to a negative number, `clamp(0, negative)`
raises `ArgumentError: min argument must be less than or equal to max
argument`, causing a 500 on inbox creation.

Ensure `total_count` is floored at 0 so the clamp range is always valid.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:51:04 -03:00
..
account fix(captain): prevent clamp ArgumentError when captain limits are negative (#242) 2026-03-19 20:51:04 -03:00
audit Merge branch 'main' into chore/merge-upstream 2025-06-09 19:49:48 -03:00
concerns feat: Conversation workflows(EE) (#13040) 2026-01-27 11:36:20 +04:00
account_user.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
account.rb fix: V2 Assignment service enhancements (#13036) 2026-02-11 12:24:45 +05:30
activity_message_handler.rb feat: Improve Captain interactions, activity messages (#11493) 2025-05-16 19:27:57 -07:00
application_record.rb feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
audit_log.rb chore: Refactor Response Bot Data Schema (#8011) 2023-10-01 19:31:38 -07:00
automation_rule.rb feat: sla-2 add automation backend support for SLA (#8775) 2024-02-01 15:42:12 +05:30
channelable.rb chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
conversation.rb feat(voice): Incoming voice calls [EE] (#12361) 2025-09-08 22:35:23 +05:30
inbox_agent_availability.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
inbox.rb fix: Add account_id to the query to force using a better index (#12420) 2025-09-11 22:27:38 -07:00