Call API sends old data

Mac OS, Brave browser & Safari browser

Describe the bug:

  • I have noticed this in few of my apps. When making a API call (action) that has a column value in the payload (user specific column in this case) the first time everything works fine. If I change the value inside the column, the app UI shows the new data, but sends the old data from the column. It takes maybe a minute or few for the payload to update.

Expected behavior:

  • The data that is sent to the call API should be upto date with the UI.

How to replicate:

  • Make an API call that has a user specific column value in the payload.
  • Then edit the column value
  • Right away do another api call
  • Check what payload was sent.

@Loqode this sounds like the same issue you were having. Did you ever get that sorted?

Never managed to get to the bottom of it unfortunately! Ended up using Webhook instead.

But!

A temporary solution I discovered was to simply display the body of the Call API request somewhere on screen (e.g. in a text component). When the JSON payload was displayed on screen, the data was up-to-date. When the payload wasn’t displayed on screen, it was sending data that appeared to be “1 update behind” what it should have been.

So a somewhat hacky way to resolve this would be to display the json payload (body of the request) on screen (e.g. at the bottom of the page) in a rich text component and set the colour of the text to the colour of the background so it’s technically still displaying on screen but remains somewhat invisible. And if it’s a large request you can reduce the font-size etc to reduce the space that the rich text component uses.

2 Likes

Or maybe use a span class but set the height to 0. As long as the content of that block is updated, I think it should work.