iachat/app/javascript/dashboard/store/modules/specs
Shivam Mishra 9761214860
feat: Add debounce for meta query (#11195)
This PR combines the approaches in
https://github.com/chatwoot/chatwoot/pull/11190 and
https://github.com/chatwoot/chatwoot/pull/11187 to debounce the meta
request with a max wait time of 2.5 seconds With 500 concurrent users,
the theoretical limit with this is 720K requests per minute, if all of
them continuously receive websocket events.

The max wait of 2.5 seconds is still very generous, and we can easily
make it 2 seconds for smaller accounts and 5 seconds for larger
accounts.

```js
const debouncedFetchMetaData = debounce(fetchMetaData, 500, false, 200);
const longDebouncedFetchMetaData = debounce(fetchMetaData, 500, false, 5000);

export const actions = {
  get: async ({ commit, state: $state }, params) => {
    if ($state.allCount > 100) {
      longDebouncedFetchMetaData(commit, params);
    } else {
      debouncedFetchMetaData(commit, params);
    }
  },
  set({ commit }, meta) {
    commit(types.SET_CONV_TAB_META, meta);
  },
};

```

Related Utils PR: https://github.com/chatwoot/utils/pull/49
Here's the debounce in action

<img width="934" alt="image"
src="https://github.com/user-attachments/assets/5265a108-9c64-4488-9b4c-2e0d06aadc50"
/>

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
2025-03-27 19:41:02 -07:00
..
account feat: Replace rtlMixin to a composable (#9924) 2024-08-12 15:50:21 +05:30
agentBots feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
agents feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
attributes feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
auth feat: Add dropdown component (#10358) 2024-11-18 17:29:27 -08:00
automations feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
bulkActions feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
campaigns feat(v4): Update the campaigns page design (#10371) 2024-10-31 11:57:13 +05:30
cannedResponses feat: Update the design for canned responses (#9903) 2024-08-07 09:43:47 -07:00
contactConversations feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
contactLabels feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
contactNotes feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
contacts feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
conversationLabels feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
conversationMetadata Feature: Contact Panel with conversation details (#397) 2020-01-01 22:30:43 +05:30
conversationPage feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
conversations feat: remove sentry log and allow same timestamp (#11100) 2025-03-18 15:08:28 +05:30
conversationSearch chore: Search improvements (#10801) 2025-02-03 19:34:50 +05:30
conversationStats feat: Add debounce for meta query (#11195) 2025-03-27 19:41:02 -07:00
conversationTypingStatus feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
conversationWatchers feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
csat feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
customRole chore: Custom Roles to manage permissions [ UI ] (#9865) 2024-09-17 11:40:11 -07:00
customViews feat: Add new sidebar for Chatwoot V4 (#10291) 2024-10-23 18:32:37 -07:00
dashboardApps feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
draftMessages feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
inboxAssignableMembers feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
inboxes feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
integrations feat: Update the design for integration page (#9825) 2024-07-24 16:35:40 -07:00
labels feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
macros feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
notifications feat: Add unread badge to sidebar for inbox view (#10803) 2025-01-31 15:14:10 +05:30
reports feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
sla feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
slaReports feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
teamMembers feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
teams feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
userNotificationSettings feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
webhooks feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
summaryReports.spec.js feat(v4): Update the report pages to show aggregate values (#10766) 2025-01-28 09:19:18 +05:30