Commit Graph

26 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
Shivam Mishra
07ea9694a3 feat: new accounts controller for signup+onboarding (#8804)
* feat: add v2 accounts controller

* feat: allow empty account and user name

* feat: ensure  and  is present for v1 signup

* test: remove validation checks

* chore: apply suggestions

* chore: revert en.yml formatting

* chore: line at EOF

* fix: routes

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-02-02 16:10:45 +05:30
Shivam Mishra
a86e236d19 feat: update cache headers for cache_keys (#7283)
Update the cache headers for cache_keys to max-age=10, private, stale-while-revalidate=300

1. The cache will be fresh for 10 seconds (max-age=10). During this time, the browser will use the cached version without checking with the server.
2. After the initial 10 seconds, the browser can continue to serve the stale cache for up to 5 minutes (stale-while-revalidate=300). During this period, it will also try to revalidate and update the cache in the background.
3. After 310 seconds in total (10 seconds fresh, 300 seconds stale), if the browser has not been able to revalidate the cache, it will attempt to fetch the fresh resource directly from the server for subsequent requests, causing potential latency equivalent to a network request.

This means that the data will be directly revalidated only every 5 mins. Other times, it will stay fresh for 10 seconds and revalidate in the background. In most cases, we won't have to rely on a cache validation check because there is a WebSocket event for revalidation, so we know if something changes.

Right now the stale-while-revalidate is 5 minutes, we can then move it to 15 minutes.

> The stale-while-revalidate header is not supported in Safari, for Safari the cache keys will only stay in memory for 10 seconds before being marked stale
2023-06-14 13:21:51 +05:30
Sojan Jose
7ab7bac6bf chore: Enable the new Rubocop rules (#7122)
fixes: https://linear.app/chatwoot/issue/CW-1574/renable-the-disabled-rubocop-rules
2023-05-19 14:37:10 +05:30
Shivam Mishra
00ee0478eb feat: IndexedDB based caching for labels, inboxes and teams [CW-50] (#6710)
* feat: allow caching of labels in the account scope

* feat: send cache keys in account json response

* feat: kickstart web worker

* feat: setup basic architecture for workers

* feat: install idb

* feat: add datamanger

* fix: typos

* refactor: rename method

* feat: make init db a manual step

* refactor: separate accountIdFromRoute

* feat: cache enabled API client

* feat: enable caching for inboxes and labels

* feat: enable cache for team

* feat: manage exceptions for team

* feat: add team to data manager

* feat: add a generic listener

* refactor: send only cache keys

* refactor: separate validate method

* feat: add listeners

* feat: add event for revalidate

* feat: add cache keys endpoint

* refactor: fetch cache keys instead of full account data

* fix: key pattern

* feat: don't fetch account for cache_keys

* fix: cache key base class

* refactor: cache keys helper

* feat: add helper

* fix: cache-key update logic

* feat: delete indexeddb on logout

* feat: remove worker.js

* refactor: move data-manager

* refactor: name of file

* feat: add test for DataManager

* refactor: add fake idb to jest setup

* test: cache keys helper

* test: cache keys helper

* test: cache_keys in accounts controller

* refactor: remove cache_keys context

* feat: add policy for cache-keys
2023-03-27 12:16:25 +05:30
Geophilus Durairaj
bd445216e9 fix: DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated (#5560)
fixes the warning: Rendering actions with '.' in the name is deprecated
2022-10-05 17:24:34 -07:00
Tejaswini Chile
f6891aebbb fix: Set account default language in account API (#5086) 2022-07-26 22:42:20 +05:30
Pranav Raj S
ea44a32758 feat: Add hCaptcha for public forms (#4017)
- added hCaptcha based verification for chatwoot signups

Co-authored-by: Sojan <sojan@pepalo.com>
2022-02-18 20:02:50 +05:30
Vishnu Narayanan
acba07cf6e chore: revert GlobalConfig changes (#3702)
Priority to GlobalConfig changes are reverted and for the time being, env vars will take precedence if set.

Fixes #3699
2022-01-11 19:20:23 -08:00
Vishnu Narayanan
97ee1bfa97 feat: add GlobalConfigService to support env vars migration (#3288) 2021-11-03 21:34:42 +04:00
Sojan Jose
a5bc81b304 chore: Suppress the unnecessary CSRF warning (#2606)
Suppress the unnecessary CSRF warning
2021-07-14 18:40:24 +05:30
Sojan Jose
467b45b427 feat: Improved password security policy (#2345)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-06-07 17:26:08 +05:30
Pranav Raj S
ba06fe1cb2 feat: Update notification in account settings (#1660) 2021-01-17 23:59:09 +05:30
Pranav Raj S
9d3dda9a61 feat: Add full name to the user signup form (#1534) 2020-12-21 14:05:19 +05:30
Akash Srivastava
074084b258 feat: Auto resolve conversations after n days of inactivity (#1308)
fixes: #418
2020-11-01 12:53:25 +05:30
Ronald Walker
cbe9e06472 chore: DRY up check_authorization method (#1351) 2020-10-20 19:22:21 +05:30
Divyesh Kothari
89ed0b425b feat: Ability for the logged in user to create a new account (#985)
Co-authored-by: Divyesh <dkothari@box8.in>
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-07-26 12:54:50 +05:30
Sony Mathew
96efc44b82 Chore: Feature lock email settings in UI (#1065)
* Chore: Feature lock email settings in UI

The email settings under account settings needed to be
feature locked in a way different from teh current way for it
to be enabled for accounts in a self hosted scenario.

Some refactorings were also done along with this change.

1. There was a feature flag defined in code in account model called
domain_emails_enabled was used to check if the inbound emails was
enabled for the account. But there was already a feature flag called
"inbound_emails" defined in features.yml. So changed to use this to
check if inbound emails are enabled for an account.
2. Renamed and re-purposed existing `domain_emails_enabled` to
`custom_email_domain_enabled` to use for feature toggling the UI
for email settings.
3. To enable & disable multiple features using the featurable concern
we were passing an array of values. Changed this to accept a comma
separated set of values.

* Chore: Feature lock email settings in UI

Fixed the specs for accounts controller & removed
unneccessary code from Account seetings component in UI

* Chore: Convert newlines to <br>s

Removed the layout used while sending replies in
conversation continuity.

Converted the newlines in the messages to <br/> tags
for the correct HTML rendering.

* Chore: Bug fix in reply email domain

Renamed the function custom_email_domain_enabled  to
inbound_email_enabled.

Fixed bug on setting reply emails's domain.
2020-07-19 23:08:07 +05:30
Sojan Jose
52d28105e4 Chore: Remove dead code related to billing (#935)
- remove subscription model
- remove billing-related code
2020-06-07 20:31:48 +05:30
Sojan Jose
051871a3cd Chore: Code Cleanup in API controllers (#932)
* Chore: Code Cleanup in API controllers

* Remove unnecessary scoping for accounts controller
2020-06-07 13:58:05 +05:30
Sojan Jose
19ab0fe108 Chore: Scope URLs with account_id (#601)
* Chore: Enable Users to create multiple accounts

Addresses: #402
- migrations to split roles and other attributes from users table
- make changes in code to accommodate this change

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-03-09 23:27:10 +05:30
Sojan Jose
b05f843790 Chore: Making Account Signup Optional (#563)
Introduce new environment variable that lets you control account signups
ENABLE_ACCOUNT_SIGNUP :( true | false | api_only )
Fixes: #406

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-02-29 11:20:33 +05:30
Pranav Raj S
005ca62c6e Bug: Fix signup 500 error (#389) 2019-12-26 11:52:14 +05:30
Sojan Jose
f98cd83a29 Code-climate duplicate code fixes (#382)
* Code-climate duplicate code fixes

* Spec for accounts controller
2019-12-24 17:32:27 +05:30
Pranav Raj S
94c6d6db6f 🚨Fix Rubocop lint errors 2019-10-20 14:17:26 +05:30
Pranav Raj Sreepuram
2a34255e0b Initial Commit
Co-authored-by: Subin <subinthattaparambil@gmail.com>
Co-authored-by: Manoj <manojmj92@gmail.com>
Co-authored-by: Nithin <webofnithin@gmail.com>
2019-08-14 15:18:44 +05:30