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
33.19k stars 3.6k forks source link

[Bug]-[12]:"Aw, snap!" error when rating widget is provided a large number as max value #14833

Open subrata71 opened 2 years ago

subrata71 commented 2 years ago

Is there an existing issue for this?

Description

When I try to provide a large number as the max value in a Rating widget then the entire application snaps and it doesn't seem to return to its normal state. And if such value is provided in a way so that it comes from on page load event then there will be no way to escape from it.

Use Case

Let's say a user is trying to build an application with Appsmith. The user wants to use a rating widget but instead of putting a hardcoded value in the maxValue field of the widget he/she wants to provide the value from some other place e.g. a query, an input widget, etc. Let's assume the value gets messed up somehow i.e. it is having a large number. And the user will end up experiencing this issue.

Reference

Loom Video

Steps To Reproduce

  1. Drag and drop a Rating widget
  2. Put a large number in the max value of the widget e.g. a number with 6 digits
  3. You should see the entire application snaps and it doesn't return to its normal state

Public Sample App

https://www.loom.com/share/0ea0097f3f4e4e43b0905257463597ff

Version

Cloud / Self Hosted

dilippitchika commented 2 years ago

Fix -

  1. Limit the max rating value to 100, saw 3 instances of data where this was set to 100.
  2. For any new or existing widgets where value is set to greater than 100 -
    • Show an error in the property pane
    • Show only upto 100 items in the rating
    • Fill all the items if default value >= 100

CC @somangshu

dilippitchika commented 2 years ago

Stats

Stat Values
Reach 3
Effort (months) 0.5
somangshu commented 2 years ago

@dilippitchika as explained in the user case, if there is a binding, then we reach an irrecoverable state. Can we also check how many user used binding for the max value.

dilippitchika commented 1 year ago

Only 2 users used binding for max value here.