Commit Graph

6 Commits

Author SHA1 Message Date
Pranav
4a83e70158 fix: Avoid throwing 406 for non-json requests (#11701)
Users get confused between app routes and API routes. Instead of hitting
/api, they append /app in the API call, which ends up calling the
dashboard controller and throws an error. To fix this, we added a check
to throw a 406 Not Acceptable for non-HTML requests. But Meta requires
Accept: \*/\* to return 200 for the integration to be accepted.

This change will only throw an error for JSON requests.

Fixes #11697
Fixes https://github.com/chatwoot/chatwoot/issues/11251
Fixes https://github.com/chatwoot/chatwoot/issues/11205
2025-06-10 15:12:32 -04:00
Pranav
ccf890d855 fix: Handle JSON requests in DashboardController (#10910)
This is the error that is triggering a P0 incident in Chatwoot. 

```
DashboardController#index is missing a template for this request format and variant. request.formats: ["application/json"] request.variant: []
```

The user is calling `/app/accounts/api/v1/accounts/<account-id>/inboxes`. The URL is wrong, the requests are routed to dashboard controller as it starts with `/app/accounts`. The dashboard controller is not handling JSON requests and it creates errors. There are 312k errors over the last 2 years. Close to 50k during last 3 days.

This fix would return not_acceptable response to the attempts.
2025-02-15 09:32:50 -08:00
Akhil G Krishnan
84df9c807d chore: Add climate-control gem for handling the test ENV vars (#3267) 2021-10-25 13:13:25 +05:30
Sojan Jose
3b39eb3e33 chore: ability to run Chatwoot as API only server (#2344)
- Ability to run chatwoot as an API only server
- Removes action cable testing gem since it is merged to rails 6
2021-05-27 20:07:21 +05:30
Pranav Raj S
a9344fbf4c fix: Add missing switch_locale on DashboardController (#1631) 2021-01-09 01:43:17 +05:30
Tim Lange
bc884ae184 Chore: Added tests for dashboard_controller (#529) 2020-02-21 00:43:14 +05:30