API workflow out of sync with database

I have a custom plugin that runs server side, it grabs a thing from the database and loops over the properties to produce a nested object. This plugin runs on a backend workflow when the API hit to create the nested object which is then returned to the client that made the request.

The problem is that if I update a property on the thing it is not being updated in the response from this backend workflow. The change is showing on the database just fine but when its returned from the API the old value is shown.

Can anyone tell me where the caching is occurring here and how to disable it?

If it is a custom plugin any changes would have to be made there.

You could consider building the logic with Bubble expressions as well.

Its a custom plugin that I built myself @cmarchan and there is definitely no caching logic there - it simply creates an object and stringifies it before returning it to the caller.

Could you expand?

I take that back. I see the problem.

Bubble is evidently keeping on page what it returned first since it is not coming from the dB.

You may be interested in approaching Bubble support with this use case. Should you choose to do so, please do share their answer as it could shed much light to many of us. :smiley:

1 Like

@Jici … any comments on the above perhaps?

I actually started seeing this yesterday too. Data wasn’t being updated without a refresh on the page. @veribuy please submit a bug report and I will try to as well. I think this has happened before. :blush: It might be a separate issue but, either way, a bug report should probably be submitted.

Also, just to make sure. One way to make sure the data is returned in the right order is by using ‘result of step’. You might want to try that if you aren’t already.

1 Like

Can you explain and maybe share screenshot of exactly what you are doing in both plugin and backend WF? Also, how do you call the backend WF… using API connector? (probably the case if you want to send a response to the front end without DB involved). In this case, if the API Connector call stay the same, Bubble use cached data.

2 Likes

Heres an explanation of what i’m doing:

  • A form on bubble with various input fields that the user can edit
  • When the user clicks save, it initiates a flow on my own server that results in an call to an API workflow that returns the result of my custom plugin to the caller
  • The custom plugin just takes a thing (from the database) and nests related data and returns a simple JSON response
  • When the thing changes however, the old value is still returned from the API value even though the database has updated

So to answer your questions directly, In the plugin I am returning a value from the database in JSON form and in the api/backend workflow I am returning this JSON value from the plugin to the client

For clarity, im returning an array of of things from the custom plugin, if I add a new thing to this array then that new item is returned however if I update a property on that thing, the old value is returned which leads me to believe that its not the request that is being cached.

@Jici @J805

I have a similar issue where the backend workflow is sending out email and setting a flag on a thing. If I create a button to refresh the count it does not change how many are left to be sent. Only after some time will the count automatically change it’s count result.

@Jici could you shed some light on what is being cached and where?

@J805 Did you submit anything?

Support seem difficult to reach on my end but not sure if the Forum is the correct for this, this issue is a possible show stopper for using Bubble

@veribuy I’m I would recommend reporting it. I have been seeing the issue show up again recently. Might need to do another bug report.

Alright cool il report it and post back here if they reply

This topic was automatically closed after 14 days. New replies are no longer allowed.