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.43k stars 3.72k forks source link

[Bug]: Table default selection row doesn't work when primary key is set with server-side pagination #21108

Open kamakshibhat-appsmith opened 1 year ago

kamakshibhat-appsmith commented 1 year ago

Is there an existing issue for this?

Description

Table default selection row doesn't work when primary key is set with server-side pagination

Steps To Reproduce

  1. Configure a query with table which has LIMIT and OFFSET set for pagination
  2. Select primary key
  3. Set any value in default selected row 4.Change pages

Public Sample App

No response

Environment

Production

Issue video log

https://www.loom.com/share/92968e00a9bf4b84a1d03c9a6a765ee3

Version

Cloud

somangshu commented 1 year ago

Something weird going on here. Probably related to primary column. This was working before and is also a regression https://user-images.githubusercontent.com/11089579/225329048-c789aebb-a4ac-4963-b176-9e05f42d12f6.mov

cc @dilippitchika @keyurparalkar @sbalaji1192

rajatagrawal commented 1 year ago

Notes from discussion with @dilippitchika

The default selected row feature, when primary key is enabled, is working similar to its counterpart in list widget. It is trying to select rows whose primary key column value is equal to the value entered in the input box for default selected row input box.

Question : What is the intended functionality of this feature ? Option 1 : To select rows by index for value passed in default selected row index input field Option 2: To select rows by value for value passed in default selected row index input field.

If Option 1, Fix: I can remove the code for Option 2 already present.

If Option 2: The bug in this case seems like the lack of ability for the user to deselect primary key option from the UI. If the user is able to deselect primary key column, then they won't be stuck and can be unblocked for carrying out other tasks for the table widget.

Please suggest @kamakshibhat-appsmith @dilippitchika @somangshu

cc : @keyurparalkar

dilippitchika commented 1 year ago

Is there any performance value people are currently getting from the feature if primary key is selected? @rajatagrawal

rajatagrawal commented 1 year ago

no, there aren't any performance related concerns in both approaches.

rajatagrawal commented 1 year ago

Flowchart of cases when the bug happens

Untitled.drawio.pdf

saiprabhu-dandanayak commented 5 months ago

Hi @rajatagrawal , @dilippitchika , @somangshu , i have raised Pr for this bug , Could You assign a reviewer . Thanks in advance.

rajatagrawal commented 5 months ago

Reverted here