Bulk Update via Primary Key

I am seeing a new issue/bug across all of my apps today that use the Bulk Update via Primary key on a table.

I am triggering this query on a table save. I can see that the changeset properly reflects the changes to a row. Then when the user hits save, I can see for a split second a new record gets added to the changeset. It appears to be what other column/field in the table the user happens to be on when they hit save. The effect is it takes the value in the changset and also writes to the field above if the user has their mouse there, or say in a column called description if they are there.
To make clearer, if they change qty from say 1 to 5, then click out of that field, the changeset array shows the one edit. But wherever else they are with mouse when they hit save, 5 gets updated there as well.

3 Likes

Hello @Wayne_Hopkins ,

Could you please provide some screenshots or a screen recording to help us better understand the issue?

Thanks!

5 Likes

i can see the bug too, i will record a video showing that - it looks really like a fatal bug that affects my app and also overwrites some data in other columns (that shouldnt be toched by save) - my client reported me this today

here is the video where you can see this bug and strange changeset behaviour in my app: https://www.berrycast.com/conversations/fab670c0-337f-552e-8aac-d09434bc6399

In the video there are some strange things happening in changesetArray, like automaticaly adding new non-existing column just after i hit save - then i got error like this:

update "Lines" set "line_comment" = $1, "RetoolInternal-e7b3f715-3175-457f-a9f7-010cb089b65c-GroupedColumnId" = $2 where "id" = $3 - column "RetoolInternal-e7b3f715-3175-457f-a9f7-010cb089b65c-GroupedColu" of relation "Lines" does not exist

+1 on this bug
Seems like values in the changesetArray are getting overwritten with random values from the table (or previous update attempts?), resulting in type errors or wrong values saved in wrong columns

1 Like

Hey @kpalik

You can use the selectedRows instead of changesetArray if you want

For that flow you can use this forum Forum

It will help you.

5 Likes

hmm, but my table has inline edits and users do multiple edits and then click save - they typicaly have selected only one row - last one they edited

You can convert your table into a multi-select-row

5 Likes

it is still not the solution because my users wont select multiple rows before saving. The workaround that @gasperblk provided on Discord is way better and i used it

  1. delete saveaction from table
  2. create new independent button and use it as a save button, you can add some logic to disable if there are no changes in table or the save query is running, it looks like this in my app:

Instead of this use the additional scope it will work perfectly.

5 Likes

Hey folks - Thanks for flagging, I'm seeing the same thing and am digging in with the owning team on this now!

3 Likes

Much appreciated.

No problem! We just reverted a change that led to some funkiness between the tentative table updates and the selected rows. That's starting to roll out now, will loop back once that's complete.

6 Likes

+1 on this

When I click save, the record next to the one I edited also automatically get added to the changesetArray.

1 Like

Hey all - the fix that @jmann mentioned above rolled out with the release of Cloud version 3.185.0. Let us know if it's still not working as expected!

3 Likes

All good now. Great work and thanks for the fast fix to the team.

1 Like