appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: TypeError: Cannot read properties of undefined (reading 'value')

Open sentry[bot] opened this issue 3 years ago • 5 comments

Sentry Issue: APPSMITH-490

TypeError: Cannot read properties of undefined (reading 'value')
  at onClick (pages/Templates/ForkTemplate.tsx:58:70)
...
(13 additional frame(s) were not displayed)

sentry[bot] avatar Oct 12 '22 09:10 sentry[bot]

@kocharrahul7 @ginilpg the app is crashing when users fork a template

Nikhil-Nandagopal avatar Oct 12 '22 09:10 Nikhil-Nandagopal

Able to repro. When there are no organisations and we try to fork the app we see the error on the browser console. The app doesn't crash. Fork buttons needs to be disabled here.

akash-codemonk avatar Oct 12 '22 10:10 akash-codemonk

Just checked the smartlook as well, No error message for the user, they just tried to fork without selecting an org. Nothing broke.

kocharrahul7 avatar Oct 12 '22 10:10 kocharrahul7

@kocharrahul7 @akash-codemonk we're seeing a lot of occurrences of this. Can we please validate whether this is really only for no org. It doesn't seem likely

Nikhil-Nandagopal avatar Dec 05 '22 08:12 Nikhil-Nandagopal

I see a total of 52 events in the last month. The reason is the same it is zero orgs or there are no orgs where the user has permission to fork.

akash-codemonk avatar Dec 06 '22 05:12 akash-codemonk

@akash-codemonk then maybe we;re showing the workspace in the dropdown but they don't face the permission to fork it there. So we should stop showing the workspace in the dropdown list

Nikhil-Nandagopal avatar Dec 08 '22 07:12 Nikhil-Nandagopal

The workspace list is filtered. So the user isn't actually seeing any workspace in the modal dropdown, but they end up clicking the fork button which is when the error is thrown.

As a fix I am hiding the fork button if the user does not have any workspace to fork to. This can happen for two reasons

  • There are no workspaces the user is part of
  • The user is part of a workspace/s but user does not have permission to fork to any of the workspaces

Media

https://user-images.githubusercontent.com/67054171/209554970-7f71cfa5-308d-4775-a83e-38e1ffb2247f.mov

akash-codemonk avatar Dec 27 '22 07:12 akash-codemonk