openblocks-dev / openblocks

🔥 🔥 🔥 The Open Source Retool Alternative
https://cloud.openblocks.dev
GNU Affero General Public License v3.0
5.88k stars 360 forks source link

[Bug] Queries runs before the value of table's selected row changes #308

Closed agolosnichenko closed 1 year ago

agolosnichenko commented 1 year ago

There is a bug in Table component, here is an example:

  1. In Table I have custom column of Links type, f.e with Modify and Delete links
  2. Delete action runs simple SQL-query like "DELETE FROM some_table WHERE id = {{table1.selectedRow.id}}"

The problem is that the query runs before the value of selectedRow changes and this potentially results in user deleting the wrong record (check the attached screencast).

The solution is to fix the logic so that queries should be executed only after all table's promises are resolved

https://user-images.githubusercontent.com/60524281/224572972-207c5faf-b30c-46db-a661-0fb94ec7819c.mp4

lmx1117 commented 1 year ago

Thank you for reporting this 👍, we will check into this asap

MichalisDBA commented 1 year ago

Yes, same thing happened to me and i was first confused of what just happened while testing an app i built.

lmx1117 commented 1 year ago

@MichalisDBA @agolosnichenko Sorry for the misleading 😣, this issue has already been solved, now you can update to check.

agolosnichenko commented 1 year ago

@MichalisDBA @agolosnichenko Sorry for the misleading 😣, this issue has already been solved, now you can update to check.

Thank you! It works