Commit Graph

284 Commits

Author SHA1 Message Date
Pranav Raj S
00eb5b152a chore(migration): Re-run database migration job for caching. (#8581)
A support request that came to Chatwoot Cloud revealed that the job was timed prematurely. The default timeout for Sidekiq queues was set as 25 minutes in sidekiq.yml file. The cache was not created properly for the accounts with more than 100k conversations.

This change removes the cache logic in the previous migration and creates a new migration with a new job which processes conversations in batch.
2023-12-18 17:29:02 -08:00
Pranav Raj S
890515edfd feat(perf): Cache labels on the conversation model (#8527) 2023-12-11 18:27:55 -08:00
Muhsin Keloth
76711d95ff chore: Change primary actor to Conversation for all the notification types. (#8435) 2023-12-06 10:43:09 +05:30
Muhsin Keloth
449503bb94 feat: Snooze notification API (#8439) 2023-12-04 12:32:35 +05:30
Shivam Mishra
5588d6e344 feat: convert feature_flag to bigint [CW-2767] (#8350)
Co-authored-by: Sojan <sojan@pepalo.com>
2023-11-17 15:50:24 -08:00
Sivin Varghese
35a9acf099 feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
Sojan Jose
a3d008da06 chore: Ensure null validation for private attribute in messages (#8085) 2023-10-11 13:16:59 +05:30
Pranav Raj S
3a547de909 fix: Update the default status of the hooks to enabled (#7652)
In the recent Slack integration update, we made changes to how hooks are handled. Now, hooks require an additional check to be enabled. By default, new hooks are created in a disabled state, which might lead to issues with the hooks not being executed as expected.

This migration updates the status attribute of hooks to have 'enabled' as the default value, ensuring that new hooks are enabled by default and can function properly.
2023-08-01 12:14:47 -07:00
Shivam Mishra
ff97536095 feat(perf): contact page loading speed (#7629) 2023-07-27 13:32:22 +05:30
Sojan Jose
1d718b92b7 chore: Fix schema disparities (#7554)
- Fixing the schema disparities that crept up during merges
- Also, fix the issue with migrate command regenerating the schema for contacts.rb model
2023-07-19 19:15:43 +03:00
Pranav Raj S
ec65b43993 feat: Add support for API key authentication in Twilio (#7523)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2023-07-14 19:20:54 -07:00
Tejaswini Chile
10dd0ba647 feat: Sentiment Analysis (#7475) 2023-07-12 15:03:31 +05:30
Tejaswini Chile
71837bedf9 feat: Ability to customise the email sender name [CW-1629] (#7345) 2023-07-04 20:46:01 +05:30
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
Sojan Jose
595e6e79f0 chore: Add sla policy association to conversation (#7360)
Adds the sla policy association to the conversation

Fixes: https://linear.app/chatwoot/issue/CW-1615/applying-an-sla-to-the-conversation
2023-06-21 14:48:50 +05:30
Shivam Mishra
429ec7194f feat: add index to reporting events [CW-1960] (#7294)
* fix: annotation

* feat: add better index for reporting_events
2023-06-12 18:23:42 +05:30
Tejaswini Chile
879a244f93 fix: Automations condition based quoted text (#7272) 2023-06-09 17:00:05 +05:30
Shivam Mishra
44b1047b90 feat(perf): contacts query performance (#7175)
* feat: use more indexable where condition

* feat: add index concurrently

* chore: update schema

* refactor: update index name
2023-05-23 17:22:47 +05:30
Shivam Mishra
c70367bbd7 feat: add migration to fix image signed keys (#7076) 2023-05-15 15:13:26 +05:30
Muhsin Keloth
271263bcc2 feat: SLA CRUD APIs (EE) (#7027)
Fixes: https://linear.app/chatwoot/issue/CW-1613/sla-api

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-05-11 22:42:56 +05:30
Muhsin Keloth
c97d6021e0 chore: Add migration to set the default empty string value for contact name (#7052)
Fixes: https://linear.app/chatwoot/issue/CW-1650/issue-with-the-contact-name
2023-05-11 17:35:19 +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
Sojan Jose
022383d942 chore: Upgrade to Rails 7 (#6719)
fixes: #6736
2023-05-06 10:44:52 +05:30
Sojan Jose
3fa654f5c6 chore: Add Index for widget contact lookup (#6998)
- Adds an index to improve the contact lookup performance while calling setUser from widget
2023-04-26 19:22:16 +05:30
Tejaswini Chile
e3193dcabc feat: Link help center portal to an Inbox (#6903) 2023-04-24 12:49:52 +05:30
Shivam Mishra
9c0259da6b feat: add priority field to conversation (#6921) (#6927)
* feat: add priority

* feat: add indexes
2023-04-19 13:23:14 +05:30
Shivam Mishra
ca2506a941 feat: allow sorting of articles (#6833)
* feat: sort by position

* chore: whitespace change

* feat: add border bottom color to list item

* feat: allow dragging articles

* feat: add migration to reorder all articles

* feat: add onsort method

* feat: finish UI sorting

* feat: show 50 per page in articles list

* feat: add article sorting methods

* feat: patch up reorder action with the API

* refactor: better naming

* chore: add comments

* feat: attach position to article before create

* feat: move article to end if moved between categories

* chore: add comments

* chore: update version

* fix: don't change position if previous category was nil

* fix: condition to trigger update on category change

* refactor: store new_position

* refactor: use grid instead of table

* feat: add snug spacing

* feat: add grab-icon

* feat: add grab icon to list

* refactor: show draggable only for category page

* feat: add update_positions as a class method

---------

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2023-04-17 14:43:10 +05:30
Pranav Raj S
91dc7733b0 feat: Use inbox image as avatar for the bot (#6859) 2023-04-07 13:25:18 -07:00
Pranav Raj S
ebd5fbef17 chore: Use feature_flags attribute instead of settings_flags (#6820)
* chore: Use feature_flag instead of settings_flag

* Remove unnecessary changes
2023-04-04 09:56:58 -07:00
Jordan Brough
803015b7f8 chore: Re-add "public" prefix to "public.gen_random_uuid()" in schema.rb (#6770)
Revert unintended schema change from https://github.com/chatwoot/chatwoot/pull/5338#discussion_r957645071
2023-03-29 16:02:13 +05:30
Jordan Brough
aa75666ad9 chore: Remove extra audit column (#6769)
- Drop unintentional "audits.integer" column
2023-03-29 12:24:14 +05:30
Shivam Mishra
bc8e8f3bb5 feat: add index to conversation id and account_id (#6757)
- This PR adds an index to conversations id and account_id. This improves the performance of some reports query
2023-03-28 22:34:04 +05:30
Sojan Jose
de8c26dce8 chore: Additional indexes and fixes (#6675)
- Fix breakage related to the look-up job in Heroku deploys 
- Add additional db indexes for performance optimisations
2023-03-15 19:52:02 +05:30
Tejaswini Chile
8f4d4798c2 feat: Backend changes for article and categories ordering (#6655) 2023-03-13 17:39:07 +05:30
Shivam Mishra
0fe05dc1b9 feat: add trigram index to tags (#6615)
Fixes: chatwoot/product#796

This migration adds a trigram index to the tags table on the name column. This is used to speed up the search for tags by name, this is a heavy sub-query when generating reports where labels are involved.

Trigram indexes are used to speed up LIKE queries; they are not used for equality queries. This is because the index is not a btree index, it is a GIN index. This means that the index is not ordered and so cannot be used for equality queries.

Read more: https://www.postgresql.org/docs/current/pgtrgm.html

The index is created concurrently: https://thoughtbot.com/blog/how-to-create-postgres-indexes-concurrently-in
---------

Co-authored-by: Sojan <sojan@pepalo.com>
2023-03-08 18:11:07 +05:30
Shivam Mishra
a6405ea339 fix: migration script to run on all reporting events (#6590)
* fix: migration script to run on all reporting events

* fix: don't update user_id if it is already present

* refactor: create a new migration

* feat: update schema

* feat: ignore events with bot handoff

* feat: prefetch conversations with handoff events

* Revert "feat: update schema"

This reverts commit 25ed2856e62655f5f1db14fd0cffad3a69d0b1fb.

* feat: update schema

* refactor: separate method get_conversations_with_bot_handoffs

* refactor: cognitive complexity

* refactor: early return if last_bot_reply is blank

* feat: add async_database_migration queue

* feat: update queue priority
2023-03-02 19:03:31 +05:30
Vishnu Narayanan
d870b0815a feat: Audit log APIs (#6434)
- Adds the appropriate APIs for Audit Logs.

ref: #6015
2023-03-01 20:02:58 +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
7044eda281 chore: Add controllers for conversation participants (#6462)
Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
2023-02-15 16:33:31 -08:00
Shubham Kumar
29025759d6 feat: Add webhook events for contact created, updated (#6415)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-13 13:28:27 -08:00
Tejaswini Chile
00cbdaa8ca Feat: Support for Microsoft Oauth in Email Channel (#6227)
- Adds the backend APIs required for Microsoft Email Channels

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Sojan <sojan@pepalo.com>
2023-01-17 02:39:05 +05:30
Pranav Raj S
2dfe38ae4d chore: Cleanup feature flags (#6096)
- Add more feature flags for CRM, auto_resolution, and reports
- Add a SuperAdmin link in the sidebar if the user is a super-admin
- SuperAdmin could view all the features on an account irrespective of whether the feature is enabled.
2022-12-19 22:38:30 +05:30
Sojan Jose
b05d06a28a feat: Ability to lock to single conversation (#5881)
Adds the ability to lock conversation to a single thread for Whatsapp and Sms Inboxes when using outbound messages.

demo: https://www.loom.com/share/c9e1e563c8914837a4139dfdd2503fef

fixes: #4975

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
2022-11-25 13:01:04 +03:00
Sojan Jose
e7f1a9ab4d chore: Enable Macros for all accounts (#5858)
- migrations to enable macros for all accounts
2022-11-16 00:33:09 +00:00
Tejaswini Chile
48373628a1 fix: Macros authorizations (#5779)
Macros policy update.

ref: #5730
2022-11-07 17:46:00 -08:00
Pranav Raj S
20b4a91122 chore: Add feature flags in the settings console (#5657) 2022-10-17 14:59:44 -07:00
Sojan Jose
5bd5395d31 chore: Add missing indexes for attachments table (#5588)
- index for attachments table
- index for conversations table
2022-10-10 15:23:33 -07:00
Tejaswini Chile
57fcb79d71 fix: Article slug auto saves (#5524)
- Auto save article slug
2022-09-30 07:25:23 -07:00