Commit Graph
5820 Commits
Author SHA1 Message Date
Sojan Jose a7cd958087 test(macros): assert assignee id in macro execution 2026-01-24 02:51:25 -08:00
Sojan Jose b0784413e9 test(mailers): set smtp env in shared context 2026-01-24 01:52:26 -08:00
Sojan Jose 2e37ecacba fix(integrations): normalize linear issue params 2026-01-24 01:41:02 -08:00
Sojan Jose 195dde9fde docs: note .env handling for specs 2026-01-24 01:23:56 -08:00
Sojan Jose 0a96b31f7f fix(integrations): set hook_type only on create 2026-01-24 01:09:24 -08:00
Sojan Jose eadd831c95 test(reports): stabilize report specs 2026-01-24 00:57:08 -08:00
Sojan Jose 0dadaccb9e Merge remote-tracking branch 'origin/develop' into chore/update-rails 2026-01-23 23:02:16 -08:00
PranavandGitHub ad2329c237 perf(conversations): throttle agent_last_seen_at updates to reduce DB load (#13355)
High-traffic accounts generate excessive database writes due to agents
frequently switching between conversations. The update_last_seen
endpoint was being called every time an agent loaded a conversation,
resulting in unnecessary updates to agent_last_seen_at and
assignee_last_seen_at even when there were no new messages to mark as
read.

#### Solution
Implemented throttling for the update_last_seen endpoint:

**Unread messages present:**
- Updates immediately without throttling to maintain accurate
read/unread state
- Uses assignee_unread_messages for assignees, unread_messages for other
agents

**No unread messages:**
- Throttles updates to once per hour per conversation
- Checks if agent_last_seen_at is older than 1 hour before updating
- For assignees, checks both agent_last_seen_at AND
assignee_last_seen_at - updates if either timestamp is old
- Skips DB write if all relevant timestamps were updated within the last
hour

- Consolidated two separate update_column calls into a single
update_columns call to reduce DB queries
2026-01-23 22:23:41 -08:00
Sojan Jose 7d1f69632e style(integrations): satisfy rubocop hook guard 2026-01-22 22:21:25 -08:00
Sojan Jose 05a5d81ad2 fix(integrations): avoid readonly hook_type updates 2026-01-22 21:56:07 -08:00
Sojan Jose ab010ab71c revert(integrations): keep hook_type assignment behavior 2026-01-22 20:33:14 -08:00
Sojan JoseandGitHub 69fabf0efd Merge branch 'develop' into chore/update-rails 2026-01-22 18:48:54 -08:00
PranavandGitHub 747d451387 chore: Improve signup flow, reduce the number of inputs (#13350)
- Improved design for the Chatwoot sign up page
2026-01-22 18:47:42 -08:00
Sojan Jose 9e53743592 test: stabilize mailer and signup validation specs 2026-01-22 18:32:08 -08:00
Sojan Jose 52d403d37c chore(vite): align vite plugin versions 2026-01-22 17:45:02 -08:00
Sojan JoseandGitHub 9ad83d101e Merge branch 'develop' into chore/update-rails 2026-01-22 09:09:25 -08:00
Sojan Jose 6caa572c24 Revert "chore(vite): upgrade vite deps"
This reverts commit 0d0abf6808.
2026-01-22 09:08:00 -08:00
Shivam MishraandGitHub 8eb6fd1bff feat: track copilot events (#13342) 2026-01-22 18:38:04 +05:30
Tanmay Deep SharmaandGitHub 75f75ce786 fix: sanitize integer fields to prevent Elasticsearch mapping errors (#13276)
## Linear task:

https://linear.app/chatwoot/issue/CW-6318/searchkickimporterror-type-=-mapper-parsing-exception-reason-=-failed

## Description

Fixes Elasticsearch `mapper_parsing_exception` errors that occur when
`campaign_id` contain non-numeric string values

## Type of change

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

## How Has This Been Tested?

- Unit tests
- use a local OpenSearch 3.4.0 cluster to verify actual indexing
behavior.


## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Removes `campaign_id` from the message search index payload to
simplify `additional_attributes`, keeping only `automation_rule_id`.
> 
> - `Messages::SearchDataPresenter#additional_attributes_data` now
returns only `automation_rule_id`
> - Specs updated to stop asserting `campaign_id` and continue
validating `automation_rule_id` and email subject handling
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5a9c8eb794a044e3f258b644f67a6731de9e904c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-22 18:29:49 +05:30
964d2f8544 perf: use account.contacts directly in search to reduce DB load (#12956)
- Use resolved contacts instead of accounts.contacts for search

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
2026-01-22 17:59:38 +05:30
Muhsin KelothandGitHub 1f5fdd7199 fix: Add Portuguese (Brazil) to CSAT template language options (#13343)
Added Portuguese (Brazil) (`pt_BR`) to the CSAT template language
dropdown
2026-01-22 15:59:24 +04:00
PranavandGitHub 9e97cc0cdd fix(whatsapp): Preserve ordered list numbering in messages (#13339)
- Fix ordered lists being sent as unordered lists in WhatsApp
integrations
- The WhatsApp markdown renderer was converting all lists to bullet
points (-), ignoring numbered list formatting
- Added ordered list support by tracking list_type and list_item_number
from CommonMarker AST metadata

Before:
Input: "1. First\n2. Second\n3. Third"
Output: "- First\n- Second\n- Third"

After:

Input: "1. First\n2. Second\n3. Third"
Output: "1. First\n2. Second\n3. Third"
2026-01-22 14:14:40 +04:00
Sojan Jose 0d0abf6808 chore(vite): upgrade vite deps 2026-01-21 17:44:01 -08:00
Sojan Jose b167e24d2b merge: develop 2026-01-21 09:18:06 -08:00
Aakash BakhleandGitHub 70d09fcc66 fix: make llm aware about signatures in editor replies (#13332)
Fixes signatures being generated on top of existing signature in draft
for improve, tone change and grammar
2026-01-21 15:52:41 +05:30
Shivam MishraandGitHub cc5ec833dc feat: check if label suggestion is enabled in hooks (#13331) 2026-01-21 15:11:41 +05:30
Vinay KeerthiandGitHub f84e95ed6c fix: use safe DOM manipulation for article heading permalinks (#13239) 2026-01-21 13:44:15 +05:30
6a482926b4 feat: new Captain Editor (#13235)
Co-authored-by: Aakash Bakhle <48802744+aakashb95@users.noreply.github.com>
Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
Co-authored-by: aakashb95 <aakashbakhle@gmail.com>
2026-01-21 13:39:07 +05:30
Sojan Jose ffe323261c revert(config): drop config loader guard 2026-01-20 23:51:54 -08:00
Sojan Jose 657afe0ffe test(reports): avoid update_column in specs 2026-01-20 23:38:54 -08:00
Sojan Jose e244d0c56d test(reports): stabilize metrics specs 2026-01-20 23:18:41 -08:00
Sojan Jose 59bf85d993 revert: action cable broadcast guard 2026-01-20 20:47:52 -08:00
Sojan Jose c8bbd6bbd8 test(linear): accept params in spec 2026-01-20 20:46:05 -08:00
Sojan Jose a1a355bc90 chore(linear): revert params to_h 2026-01-20 20:34:11 -08:00
Sojan JoseandGitHub b05311a169 Merge branch 'develop' into chore/update-rails 2026-01-20 16:48:14 -08:00
Sojan Jose c77c9c9d8a Merge branch 'release/4.10.1' into develop 2026-01-20 08:44:21 -08:00
Sojan Jose ecd4892a23 Bump version to 4.10.1 2026-01-20 08:43:11 -08:00
Muhsin KelothandGitHub 457430e8d9 fix: Remove phone_number_id param from WhatsApp media retrieval for incoming messages (#13319)
Fixes https://github.com/chatwoot/chatwoot/issues/13317
Fixes an issue where WhatsApp attachment messages (images, audio, video,
documents) were failing to download. Messages were being created but
without attachments.

The `phone_number_id` parameter was being passed to the `GET
/<MEDIA_ID>` endpoint when downloading incoming media. According to
Meta's documentation:

> "Note that `phone_number_id` is optional. If included, the request
will only be processed if the business phone number ID included in the
query matches the ID of the business
  phone number **that the media was uploaded on**."

For incoming messages, media is uploaded by the customer, not by the
business phone number. Passing the business's `phone_number_id` causes
validation to fail with error: `Param phone_number_id is not a valid
whatsapp business phone number id ID`

This PR removes the `phone_number_id` parameter from the media URL
request for incoming messages.
2026-01-20 20:32:23 +04:00
Shivam MishraandGitHub e13e3c873a feat: add report download task (#13250) 2026-01-19 18:31:52 +05:30
Shivam MishraandGitHub 0346e9a2c7 fix: captain inbox modal shows wrong assistant data (#13302) 2026-01-19 18:31:46 +05:30
Muhsin KelothandGitHub 7e4d93f649 fix: Setup webhooks for manual WhatsApp Cloud channel creation (#13278)
Fixes https://github.com/chatwoot/chatwoot/issues/13097

### Problem
The PR #12176 removed the `before_save :setup_webhooks` callback to fix
a race condition where Meta's webhook verification request arrived
before the channel was saved to the database. This change broke manual
WhatsApp Cloud channel setup. While embedded signup explicitly calls
`channel.setup_webhooks` in `EmbeddedSignupService`, manual setup had no
equivalent call - meaning the `subscribed_apps` endpoint was never
invoked and Meta never sent webhook events to Chatwoot.


### Solution
Added an `after_commit` callback that triggers webhook setup for manual
WhatsApp Cloud channels
2026-01-19 14:12:36 +04:00
b2ffad1998 fix: Validate status and priority params in search conversations tool (#13295)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 14:08:32 +05:30
Sojan Jose 77b286c41f Install libyaml build deps in Docker 2026-01-18 19:23:37 -08:00
Sojan Jose 3cf252a2fa Skip seeds in chatwoot_prepare for test 2026-01-16 15:59:22 -08:00
Sojan Jose 491eaa5bce Run chatwoot_prepare in test env on CircleCI 2026-01-16 14:33:40 -08:00
Sojan Jose 8e4483c722 Revert "Update commonmarker"
This reverts commit dd98bb398e.
2026-01-16 13:31:30 -08:00
Sojan Jose dd98bb398e Update commonmarker 2026-01-16 01:16:46 -08:00
Sojan Jose 7061c3dde0 Reduce rubocop diff 2026-01-16 01:09:07 -08:00
Sojan Jose 9ef476c6d8 Guard config loader during cache clear 2026-01-16 01:01:04 -08:00
Sojan Jose 88fc18617d Fix macro assignment spec 2026-01-16 00:40:14 -08:00