Commit Graph

106 Commits

Author SHA1 Message Date
Sojan Jose
7776b74126 chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864)
This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.

fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
2024-02-07 13:36:04 +04: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
Shivam Mishra
6e30064421 feat: handle unsupported media on the backend (#8650)
This PR logs additional information in content_attributes of a message in case it is unsupported. This info can be used by the client to render a fresh UI
2024-01-05 13:05:00 -08:00
Muhsin Keloth
db9a32a4c0 feat: Add sticker support in Line channel (#8488) 2023-12-10 20:45:44 -08:00
Shivam Mishra
7416bbb25e feat: support reply to for outgoing message in WhatsApp (#8107)
- This PR enables replies to WhatsApp.
2023-10-19 13:24:46 -07:00
Shivam Mishra
62d8ec7edb feat: support reply to for incoming messages on facebook (#8076)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-10-13 16:33:50 +05:30
Sojan Jose
a3d008da06 chore: Ensure null validation for private attribute in messages (#8085) 2023-10-11 13:16:59 +05:30
Sojan Jose
e3b8c1fbb5 fix: Include waiting on agent conversations to unattended view (#7667)
Updating the `unattended` tab to include conversations where the customer responded and is awaiting an agent's response.

Previously it showed only the conversations where the first response was pending.

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-08-15 15:09:10 -07:00
Nic Hippenmeyer
65190422c4 fix: Rename unread_since scope (#7267)
- This renames the unread_since scope to created_since, which more accurately describes what the scope returns.
- The EXTRACT(EPOCH FROM created_at) > (?) clause was also simplified and rewritten as created_at > ?, which is equivalent:
2023-07-27 12:29:21 +03:00
Jordan Brough
a7bc855486 refactor: Remove deprecated "belongs_to" relationships in Message (#7434)
- Remove the deprecated columns in message model
2023-07-27 11:41:34 +03:00
Pranav Raj S
3a77e672f8 feat: Compute average response time of replies (#7530) 2023-07-17 11:21:31 -07:00
Tejaswini Chile
10dd0ba647 feat: Sentiment Analysis (#7475) 2023-07-12 15:03:31 +05:30
Pranav Raj S
09f46aa912 chore: Update onMessage event to include conversation id (#7497) 2023-07-10 15:04:31 -07:00
Pranav Raj S
93daaea19b feat: Add a sort option for conversations waiting for a reply from an agent (#7364) 2023-06-21 13:20:39 -07:00
Tejaswini Chile
1ee6a8fe90 chore: Add validation for processed content field (#7306)
* logging the messages id for message validation exception

* Update the processed_message_content validation over length

* codeclimate

* specs failing for contacts
2023-06-14 18:28:42 +05:30
Tejaswini Chile
879a244f93 fix: Automations condition based quoted text (#7272) 2023-06-09 17:00:05 +05:30
Shivam Mishra
d0a1ad746a feat: add index migration (#7050) 2023-05-10 17:55:14 +05:30
Shivam Mishra
662967b5d3 feat(perf): add index to messages created at (#7044)
* feat: add index to messages created at

* feat: run migration
2023-05-10 11:34:49 +05:30
Muhsin Keloth
59433d9d3c feat: Adds the ability to sort conversations (#6853)
* Add sort filter

* Change UI

* Change filter

* Complete sort by filters

* Style fixes

* Fix default sort

* Update app/javascript/dashboard/components/widgets/conversation/ConversationBasicFilter.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Update app/javascript/dashboard/components/widgets/conversation/ConversationBasicFilter.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Update app/javascript/dashboard/components/ChatList.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* Added translation

* Added review fixes

* Add more updates

* Code cleanups

* Update last_activity_at on message received event

* Cleans up the design for chatlist and icons

* Fix sort

* Remove inline styles

* Add tag along with the title

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-05-05 17:08:32 -07:00
Tejaswini Chile
3c2d6faf68 feat: Instagram story replies will display the original story link (#6846) 2023-04-26 15:27:07 +05:30
Shivam Mishra
af971c9b18 fix: whatsapp template params validation (#6986) 2023-04-26 08:46:30 +05:30
Shivam Mishra
5600b518ac fix: validate template_params for WhatsApp (#6881)
- Add JsonSchemaValidator, which takes a declarative schema and validates it for a given property.
- Add specs for JsonSchemaValidator
- Enable the validator for template_params
2023-04-25 16:50:36 +05:30
Pranav Raj S
474e65f4c8 feat: Save in_reply_to from WhatsApp messages (#6964) 2023-04-23 18:28:14 -07:00
Tejaswini Chile
e69e0bc984 Add status reopen activity message for api channel (#6839) 2023-04-10 19:12:20 +05:30
Shivam Mishra
4c10845acd fix: [CW-44] don't count private message as first reply (#6707)
* fix: don't count private message as first reply

* fix: update first_human_response_logic

* refactor: separate valid_first_reply method

* test: valid first reply

* feat: add check for automation rule

* test: update step that creates data

* fix: add boundary condition in case first_reply_created_at is not present

* test: fix report builder

* refactor: conditions

* test: remove second message condition
2023-03-27 21:23:37 +05:30
Sojan Jose
da76537011 chore: Search optimisations (#6644)
- Strip search term before searching
- order messages by created_at desc
- order contacts by last_activity_at desc
- order conversations by created_at desc
- Search only resolved contacts
- Optimize resolved contacts query

ref: #6583
2023-03-13 19:10:31 +05:30
Tejaswini Chile
2abc57300c fix: Add a check for automation_created message in FIRST_REPLY_CREATED event (#6618) 2023-03-06 17:47:35 +05:30
Sojan Jose
d4e7eaecce feat: New APIs for search (#6564)
- Adding new API endpoints for search
- Migrations to add appropriate indexes
2023-02-28 22:00:36 +05:30
Shivam Mishra
06ffaa90fc fix: bots included in time to response metrics (#6409)
* feat: ignore bots in avg_first_response_time

* feat: ignore bots in avg_first_response count

* feat: add bot handoff event

* feat: add handoff event listener and reporting event

* fix: ignore agent bot in first response

* refactor: calculate first_response with last handoff

* refactor: method defn order

* test: new reporting events

* feat: Revert "feat: ignore bots in avg_first_response count"

This reverts commit de1977c219a2e7a9180dd02272244fe3b3f7ce89.

* feat: Revert "feat: ignore bots in avg_first_response_time"

This reverts commit bb9171945d5e3b2f6015f4f96dd1b76b3efb6987.

* fix: business hour calculation for first_reply

* fix: event_start_time for first_response

* feat: add migration to recompute first_responses

* refactor: separate mute helpers for conversation

* refactor: rename migration

* refactor: migration script

* fix: migration typo

* fix: typo in query

* feat: update schema.rb

* Revert "feat: update schema.rb"

This reverts commit 353ef355f2d956dd219907bb66982dc90ca5d896.

* feat: update schema

* refactor: update events as a batch job

* fix: ignore the event if value is negative

* feat: don't create a new hand-off if it's already present

* refactor: break the action into smaller chunks

* refactor: update reporting listener spec

Handle the case to ensure extra bot handoffs are not created for a give conversation

* fix: import error

---------

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2023-02-25 09:48:48 +05:30
Pranav Raj S
80784e3cab feat: Add Google Translate API Integration (#6454) 2023-02-15 20:50:45 -08:00
Tejaswini Chile
6013cc9bea fix: validate instagram story only while saving the message (#6340) 2023-01-30 13:03:59 +05:30
Muhsin Keloth
078ff615ee feat: Add support for template variables in messages content (#6215)
Fixes: #6078

Co-authored-by: Sojan <sojan@pepalo.com>
2023-01-10 16:00:34 +05:30
Pranav Raj S
cbfbe6dbad feat: Add backend APIs for Dyte integration (#6197)
- The backend changes required for Dyte Integration.
2023-01-09 12:37:18 +05:30
Pranav Raj S
69bed3e08d fix: Update unread_messages count in WhatsApp inboxes (#6154)
* fix: Update unread_count from backend instead of computing on the frontend

* Fix spec

* Remove status indicator on private notifications

* CodeClimate fix

* CodeClimate
2022-12-30 13:54:37 -08:00
Tejaswini Chile
7dc790a7e0 fix: Automatically remove expired story mention (#5300)
When a user mentions the connected Instagram page in a story, the story's content is downloaded in Chatwoot, then if the user deletes the story, the content persists in the platform.

fixes: #5258
2022-12-08 15:55:24 +03:00
Clairton Rodrigo Heinzen
edcbd53425 feat: Read/Delivery status for Whatsapp Cloud API (#5157)
Process field statuses received in webhook WhatsApp cloud API

ref: #1021

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2022-11-29 15:51:37 +03:00
Pranav Raj S
66044a0dc3 feat: Show last non-activity messages in the chat list (#5864) 2022-11-16 15:43:55 -08:00
smartdev58
9c0cce0392 chore: Mark conversations as pending instead of reopen when bot is present (#5751)
With this change, conversations are marked as pending instead of reopening when a bot is connected to that Inbox. 

Fixes: #5668
2022-11-02 13:54:56 -07:00
Sojan Jose
2423def8e8 chore: Add attachments key to message_created webhook payload (#5659)
- Add attachments key to `message_created` webhook payload
2022-10-17 17:36:56 -07:00
Tejaswini Chile
7b54990ae6 fix: Updated IMAP errors add method (#5520)
fixes: #5519
2022-09-30 11:33:00 -07:00
Pranav Raj S
cf7dac5bab chore: Add feature flag for conversation continuity in API (#5399)
- Add the ability to toggle conversation continuity in API channel
2022-09-06 18:14:36 +05:30
Sojan Jose
74fdfffe08 fix: Notification page breakages (#5236)
- Remove the cascading foreign key indexes
- Add migration to clean up existing objects

fixes: #4285
2022-08-10 13:46:46 +02:00
Sojan Jose
4187428729 chore: Update dependencies to the latest versions (#5033) 2022-07-15 09:51:59 +07:00
Pranav Raj S
3f3ee6c34a chore: Add support for message_templates in API inbox (#4835) 2022-06-10 18:40:29 +05:30
Aswin Dev P.S
360b438a55 Fix: Campaign triggers first_response reporting event (#4607)
* Fix: Campaign triggers first_response reporting event

* fix spec failure
2022-05-09 01:34:52 -07:00
Tejaswini Chile
923b4637db chore: Automation bug fix (#4442) 2022-04-12 20:23:34 +05:30
Tejaswini Chile
e06a6a7c55 Automation enhancement (#4087) 2022-03-21 13:12:27 +05:30
Tejaswini Chile
647efa12e7 fix: Attach instagram images with file type story_mentions (#4100) 2022-03-10 20:27:30 +05:30
Sojan Jose
5ad7e93059 chore: Discard activities from email notifiable messages (#3989) 2022-02-15 18:15:45 +05:30
Aswin Dev P.S
464e12ceb7 fix: Update auto reply and hide reply time for email inbox (#3985)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-02-15 17:11:28 +05:30