appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.63k stars 3.74k forks source link

[Bug]: Multiselect widget; TypeError: this.props.defaultOptionValue.some is not a function #20791

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 1 year ago

Sentry Issue: APPSMITH-5J8

TypeError: this.props.defaultOptionValue.some is not a function
  at <object>.value (widgets/MultiSelectWidgetV2/widget/index.tsx:642:37)
  at next (RouteParamsMiddleware.ts:126:10)
...
(45 additional frame(s) were not displayed)
somangshu commented 1 year ago

This change was made as part of #14485 not a lot of occurrence, but worth exploring the root cause

somangshu commented 1 year ago

If this is not useful, we need to avoid getting this logged

ashit-rath commented 1 year ago

This error seems to occur due to an extreme edge case and does not occur that frequently. Though this error can be avoided by adding a patch to the code but that would not help us find the root cause.

Due to lack of reproduction steps, we are closing this issue for now. If this issue again crops up, we will treat it as a regression and hopefully we have more information to debug this.

somangshu commented 1 year ago

@ashit-rath the issue occurred again, can you check this out to see if we can find more details around the reproduction steps.

Reopening the issue for now

somangshu commented 1 year ago

Looking at the user journey again, I did not really see any interaction with the multi-select issue. My assumption is that this is once again coming out of some template. Some missed config that is still not updated.

These are appearing more and more now a days, we need to think about how we are going to keep our DSLs updated with the ongoing development efforts. cc @GreenFlux @jacquesikot

sentry-io[bot] commented 1 year ago

Sentry issue: APPSMITH-66T

ashit-rath commented 1 year ago

@somangshu Yeah, it seems like the error occurs when the template's car-servicing page loads (assumption based on the Breadcrumbs). I still couldn't find a crash in the recording and the validation for the multiselect is pretty solid so I'm still wondering how can this happen. If somehow the evaluation skips validation for Default Selected Values during on load then I can see a possibility of such error occurring.

Regarding the new one It seems to occur in JSONForm for the multiselect field type. When the options property has a null as one of the options, the component crashes and in turn the widget crashes

Example

{{ [ { label: "asd", value: "zxc"}, null ] }}

We would have to update the validation of the options property in JSONForm Multiselect to align with the Multiselect widget's options property validation.

somangshu commented 1 year ago

@ashit-rath this occurred again today, I was not sure if your change is already on master, so I marked it resolved in the next release that is promoted.

somangshu commented 1 year ago

The issue occurred again, the frequency however is very less. Ill wait to gather more insights.

ashit-rath commented 1 year ago

@somangshu There were 2 issues that were caught in this. We fixed one of them as the other was still not reproducible. Fixed - https://appsmith.sentry.io/issues/4091661787/?referrer=github_integration Not reproducible - https://appsmith.sentry.io/issues/3802741307/?referrer=github_integration

Which one did it occur again? the first or the second?

somangshu commented 1 year ago

@ashit-rath its the non reproducible one

keyurparalkar commented 1 year ago

@ashit-rath @somangshu this issue is happening again. Here are the occurrences for the Non reproducible mentioned by Ashit above.

somangshu commented 1 year ago

@keyurparalkar were you able to get a hold of the issue?