chatwoot/app/javascript
Shivam Mishra e0ef007047
fix: Fix Sentry issues from Vite migration (#10262)
Fixes the following issues

- https://chatwoot-p3.sentry.io/issues/5966466083
- https://chatwoot-p3.sentry.io/issues/5966497518
- https://chatwoot-p3.sentry.io/issues/5966555379

For the first one, I am not sure if the fix is 100% correct, since I was
not able to reproduce, but I am confident it will work.

For both, 1st and 2nd issues, the problem came from the fact that we set
individual records to `undefined` when the intent was to remove it,
explicitly using delete fixes the issue.

### Whats up with the store changes?

Glad you asked, this comes down to Vue reactivity, previously Vue didn't
track undefined strictly, it just kinda ignored it, in Vue 3, the
reactivity changed significantly when they introduced ES6 proxies. The
Proxy tracks all property changes, including those set to undefined, so
properties remain enumerable.

So to delete a record, we actually have to the delete it using the
delete keyword, or replace the parent object with a new object splicing
the object to be deleted out.

I am assuming it worked earlier because VueX 3 reactivity was using
Object.defineProperty. Setting it to undefined might have "deleted" it
earlier

---------

Co-authored-by: Pranav <pranav@chatwoot.com>
2024-10-14 10:44:59 -07:00
..
dashboard fix: Fix Sentry issues from Vite migration (#10262) 2024-10-14 10:44:59 -07:00
design-system feat: Add histoire for component playground (#10256) 2024-10-09 22:10:53 -07:00
entrypoints fix: Resolve accountId from the route, initialize route-sync before the app is loaded (#10245) 2024-10-08 09:25:51 -07:00
portal style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
sdk fix: Avoid overflow caused by the empty span element (#9753) 2024-07-10 19:56:46 -07:00
shared chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
superadmin_pages chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
survey chore: update interpolation syntax for i18n files (#10198) 2024-10-07 11:12:40 -07:00
v3 fix: emit events across the app (#10227) 2024-10-04 08:03:41 -07:00
widget chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
histoire.setup.ts feat: Add histoire for component playground (#10256) 2024-10-09 22:10:53 -07:00