Commit Graph

2843 Commits

Author SHA1 Message Date
Sojan Jose
381fda270a chore: Fix typo in Inbox Management copy (#8750)
- Fixes the typo in Inbox Management copy -> vistors to visitors
2024-01-22 13:07:36 +04:00
Arooba Shahoor
b3c9d1f1a5 fix: clear timers and animation frame request before component unmounts (#8700)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-22 12:08:33 +05:30
Sivin Varghese
fd4376d062 fix: TypeError: Cannot read properties of undefined (reading 'emoji') (#8753) 2024-01-22 12:06:59 +05:30
Pranav Raj S
a8f053921b fix: Migrate notes when merging the contacts (#8749)
Fixes: https://linear.app/chatwoot/issue/CW-2987/migrate-notes-of-the-secondary-contact-to-primary-contact-when-merging
2024-01-20 10:32:18 +04:00
Sivin Varghese
8e15ada164 fix: TypeError: Cannot read properties of undefined (reading 'emoji') (#8747) 2024-01-19 19:55:51 +05:30
Pavel Kuzmin
e6dfc159ed fix: change teamid (#8613) 2024-01-19 16:15:28 +05:30
Chatwoot Bot
900c2de89a chore: Update translations (#8717) 2024-01-19 14:32:27 +04:00
Pranav Raj S
29106ebc4b fix: raise_lock_acquisition_error if the job cannot set the lock (#8744)
Consider a scenario where two jobs are concurrently accessing a job with a lock mechanism. If the second job accesses lock_manager.locked? before the first job called lock_manager.lock(lock_key), it would return a false positive. At this point, both jobs can be executed freely.

To address this issue, the following change ensures that only the current thread that has set the lock can execute. Otherwise, a LockAcquisitionError will be thrown.

Co-authored-by: Sojan Jose <sojan@pepalo.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2024-01-19 14:31:41 +04:00
Pranav Raj S
a579684b34 fix: Update the message-id check to use messageId parsing from mail gem (#8743)
- Update the message ID parsing logic to use the mail gem
- Update the code to improve readability
2024-01-19 14:29:04 +04:00
Nithin David Thomas
c29a9ad062 feat: Updates branding logo and name in public portal footer (#8745)
- Use white-label settings for Chatwoot Help Center

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-19 13:37:24 +04:00
Muhsin Keloth
0ac015ce7a feat: Add a job to clear notifications that were created before 1 month (#8732) 2024-01-19 13:03:23 +05:30
Muhsin Keloth
19474e0074 chore: Improve active job error logs for deserialization error (#8742)
- Improve active job error logs for deserialization error 

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-18 19:27:18 +04:00
Sojan Jose
ce8190dacf fix: API error when using SuperAdmin token (#8739)
- Fixes the issue in release 3.5.0, which causes SuperAdmin tokens to throw error during API calls

Fixes: #8719
2024-01-18 18:49:32 +04:00
Shivam Mishra
aacf326ca1 refactor: remove exception tracker (#8737) 2024-01-18 17:49:27 +05:30
Shivam Mishra
e39c14460b fix: validate url for Dashboard Apps [CW-2979] (#8736) 2024-01-18 17:48:30 +05:30
Sojan Jose
5f6e17f307 feat: Use Telegram HTML Parsemode (#8731)
- this ensures that the markdown formatted messages from the Chatwoot dashboard will render consistently in telegram UI for the supported types like bold, italics, links etc
2024-01-18 15:36:36 +04:00
Shivam Mishra
4bf23adcf5 feat: use short_summary for downloading reports [CW-2962] (#8733) 2024-01-18 16:06:13 +05:30
Pranav Raj S
1f4d860d9d fix: Use channel.inbox instead of inbox (#8734) 2024-01-18 00:46:25 -08:00
Pranav Raj S
fdbb3bf4b1 fix: Optimize email fetching logic to fix bandwidth exceeded issues (#8730)
The Inboxes::FetchImapEmailsJob is designed to fetch the entire email object and check if its message id is already in the database. However, this process is resource-intensive and time-consuming, as fetching the full email object takes a significant amount of time.

On average, fetching 100 emails can take approximately 3-4 minutes to complete depending on the IMAP server. Since we are not using server flags to identify which emails have already been fetched (to avoid compatibility issues with flags in different email services), we have to fetch all previously available emails. Currently we fetch all the messages that were created from yesterday. This becomes problematic with services like Gmail, which throttle requests based on bandwidth usage.

To address this issue, I have updated the logic as follows:

Fetch the sequence IDs of all the mails in the "Inbox" that were created from yesterday.
Use the FETCH command to fetch only the message-ids using BODY.PEEK[HEADER.FIELDS (MESSAGE-ID)] with the sequence IDs we got in the previous step. This is a faster operation with lower bandwidth usage, as it only returns the sequence ID and message ID.
Check if the message IDs are already present in the database for the selected inbox.
If not present, fetch the entire email object using the FETCH command and create the message.
If the message ID is already present, ignore it and move on to the next message-id.
I have also addressed the issue of duplicate emails appearing in conversations when two fetch email jobs occur simultaneously. I have added a lock for the channel to ensure that the job gracefully exits without waiting for the current job to complete.

Fixes #7247
Fixes #6082
Fixes #8314

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-18 11:45:16 +04:00
Muhsin Keloth
c899cc825d fix: Handle Contact import MalformedCSVError (#8706) 2024-01-18 13:05:58 +05:30
Muhsin Keloth
eb972684b3 feat: Show notification last active time instead of created time (#8724) 2024-01-18 09:41:53 +05:30
Muhsin Keloth
896473f03e fix: Notification count is incorrect when the number of notifications exceeds the page size. (#8723)
- The notification count is incorrect when the number of notifications exceeds the page size.
2024-01-17 15:14:37 +04:00
Vishnu Narayanan
88b8597e4d chore: log emails sent from chatwoot (#8721)
- Log details related to emails sent from Chatwoot to assist in debugging email delivery/bounces/complaints
2024-01-17 13:19:14 +04:00
Sojan Jose
76fe2f9bb8 chore: Switch to Markdown instead of MarkdownV2 for telegram channel (#8720) 2024-01-17 14:28:13 +05:30
Muhsin Keloth
818424259f chore: Get all notification API improvments (#8549)
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2024-01-17 09:02:18 +05:30
Sivin Varghese
e67f8824d9 fix: Backdrop color for insert article modal in dark mode (#8711) 2024-01-16 18:36:43 +05:30
Sojan Jose
8f1a1e0905 fix: Stop overwritting contact avatars unneccesarily (#8710)
While debugging a sentry error for "ActiveRecord::InvalidForeignKey ActiveStorage::Representations::RedirectController", it was noticed that we enqueue a Avatar::AvatarFromUrlJob for each setUser call, which is unnecessary. Hence making this call only if the contact doesn't have an existing avatar.

If one needs to have this avatar updated, they can go to the contacts tab and delete the current avatar, Chatwoot will pick up the new avatar in subsequent API call.
2024-01-16 16:38:46 +04:00
Mongkon Kaenjan
1b6360d9d3 chore: change OFFLINE text in th translations (#8642)
change OFFLINE text from เราไม่อยู่ to ออฟไลน์
2024-01-16 15:18:59 +04:00
Shivam Mishra
8b7f10fe61 feat: log errors on automation filter (#8702)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-01-16 16:13:57 +05:30
Chatwoot Bot
e467d15f2c chore: Update translations (#8544)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-16 13:49:38 +04:00
Nithin David Thomas
d1e7e75638 feat: Adds internal support for markdown in Telegram outgoing messages (#8640)
This PR adds support for Markdown in the telegram API for send message. The dashboard uses commonmark syntax for markdown but telegram is using MarkdownV2.
More info - https://core.telegram.org/bots/api#markdownv2-style

Adds support for bold - *bold*, _italic text_, __underline__, ~strikethrough~

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-16 13:32:59 +04:00
Sojan Jose
316cf35795 chore: Add display manifest to whitelabel settings (#8708)
- Adds display manifest to white label settings
- Improve the app config rendering with options for display name and description
2024-01-16 09:50:23 +04:00
Muhsin Keloth
52a5a59ddb fix: Handle error if the Twillio attachment download fails to download (#8705) 2024-01-15 19:13:44 +05:30
Sivin Varghese
22db201a08 chore: Hide the variable list if its empty. (#8704) 2024-01-15 15:45:36 +05:30
Shivam Mishra
ea7898d113 feat: fallback to DB localStorage for idb names (#8682)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-01-15 15:08:15 +05:30
Vishnu Narayanan
e7e14f01e4 fix: undefined method 'zero?' for nil:NilClass (#8689) 2024-01-15 15:07:36 +05:30
Muhsin Keloth
7d6085cefd fix: Log twillio attachment error (#8703) 2024-01-15 12:46:58 +05:30
Shivam Mishra
10076c6a3e feat: set lock timeout to 1 second (#8661) 2024-01-12 08:28:07 +05:30
Vishnu Narayanan
1c44445088 chore: Update the error message to the correct one (#8646)
-  Update the error message in reply_mailbox to more appropriate one.
2024-01-11 17:38:38 -08:00
Muhsin Keloth
d305c5fd0f fix: Check the file attachment URL exists before downloading attachments in Telegram. (#8679)
In rare cases, the API call to Telegram for the file path fails. We were logging the error in sentry, switching to logs instead.

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-11 17:25:46 -08:00
Muhsin Keloth
1577288843 fix: Twilo attachment download fallback to the step where authorization headers are not passed. (#8681)
In the previous release, we enabled "HTTP Basic Authentication" to secure all attachments requiring HTTP authentication. This is particularly important for media files that may contain sensitive data, as recommended by Twilio. However, some users experienced issues because they did not enable this option despite our alerts prompting them to do so.  If the authenticated attachment download call fails, add another call to download the attachment without authentication.
2024-01-11 17:23:31 -08:00
Muhsin Keloth
63b3686746 chore: Add a check to verify if the user exists before broadcasting the notification_deleted event. (#8678)
When a user is deleted, all associated notifications are also deleted from the database. As a result, the user record becomes empty. handling this case in code to prevent sentry errors.
2024-01-11 16:54:03 -08:00
Sivin Varghese
c60c523851 fix: TypeError cannot read properties of undefined (reading 'queryselector') (#8671) 2024-01-11 20:42:24 +05:30
Sivin Varghese
22c2235d90 fix: TypeError: Cannot read properties of null (reading 'assignee') (#8647)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-01-11 11:31:02 +05:30
Sojan Jose
aaf4fee9a6 chore: Fix sentry errors in email processing for bounce notifications (#8677)
This case occurs for bounce notification emails where the from address is From: "" (Mail Delivery System) . We will be discarding these emails for now.

Fixes: https://linear.app/chatwoot/issue/CW-2793/activerecordrecordinvalid-validation-failed-email-invalid-email
2024-01-10 14:30:23 -08:00
Sivin Varghese
3c21f62485 fix: Error ResizeObserver loop completed with undelivered notifications. (#8680) 2024-01-10 11:44:13 -08:00
Shivam Mishra
50b2ca014e feat: UI for unsupported message (#8660)
Display an unsupported message in UI when handling unsupported messages from channels like facebook, Instagram etc.

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2024-01-09 21:53:58 -08:00
Pranav Raj S
75a5492840 fix: Remove the usage of DragWrapper to fix the Dyte integration (#8655) 2024-01-05 15:28:20 -08:00
Shivam Mishra
56fbbe92b4 feat: trigger handoff when agent bot is the actor (#8639)
- This PR adds a feature to auto-trigger handoff events when an Agent bot toggles a conversation status from Pending to Open

Co-authored-by: Sojan <sojan@pepalo.com>
2024-01-05 15:26:52 -08:00
Sojan Jose
dc4e13b300 chore: Fix for empty update case for messages (#8641)
We observed an issue in production where the external webhook for an API inbox was failing. This, in turn, calls message update to update message status to failed. This causes a loop because rails trigger after_update callbacks even for empty commits.

Ref: rails/rails#44500
2024-01-05 13:10:26 -08:00