iachat/app/controllers/public/api/v1
Niranjan Patil b28c08059f
fix: Incorrect contact access in conversations listing (#11797)
# Pull Request Template

## Description

This PR fixes the incorrect contact access in conversations listing API.
Cause:

- `undefined method 'conversations' for nil` error because `@contact` is
not initialized

Solution:
- Using `@contact_inbox` to access `@contact`
- `@contact_inbox` is properly set in the parent controller's
`set_contact_inbox` method

Fixes
https://linear.app/chatwoot/issue/CW-4185/incorrect-contact-access-pattern-in

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2025-09-22 17:05:11 +05:30
..
inboxes fix: Incorrect contact access in conversations listing (#11797) 2025-09-22 17:05:11 +05:30
portals feat: Add INSTALLATION_NAME to global config (#12376) 2025-09-09 12:13:35 +05:30
csat_survey_controller.rb feat: CSAT response public APIs (#2670) 2021-07-28 14:59:13 +05:30
inboxes_controller.rb feat: Add inbox details endpoint (#5549) 2022-11-02 19:05:03 -07:00
portals_controller.rb feat: OG Image in Chatwoot Help Center (#11826) 2025-07-03 12:41:12 -07:00