Has something changed in the way Anvil refreshes Text Panels?

I have not used my app for about 6 months, and I’m sure there have been changes. Historically I’ve had a page where you can type into a Textarea (called “setup_update_text”), and when the lost_focus event happens it triggers a server side function to update the “setup” field for an interview I’m debriefing. All of this still works fine.

What I’ve noticed now I’m starting to use the app again is that the setup_update_text panel is not reloading the content from the server, it’s retaining whatever was there before the panel lost_focus - which is not how it used to work.

I’m using this code (which was working 6 months ago):

def update_setup(self, **event_args):
    anvil.server.call(
      'update_setup',
      self.interview,
      self.setup_update_text.text,
    )
   #refresh the setup text panel
    self.setup_update_text.text = self.interview['setup']

If I add print(self.interview[‘setup’]) then it displays the historical content, so this is no longer fetching the updated content from the database and displaying it.

What I’ve tried and what’s not working:
I attempted to use the function:

self.refresh_data_bindings()

At the end of the update_setup function, which worked, but then it also refreshes all of the other data_bindings on the page and causes them to lose their initial values, so this isn’t a workaround.

For what it’s worth I’ve got a bunch of text areas and repeating panels all on the same page, as I’m using it to listen to interviews and update different aspects of the app depending on the conversation direction in the interview.

Clone link:
share a copy of your app

1 Like

When sharing clone links that demonstrate an issue it’s best to share a minimal working example. The clone link you shared has 3 dependencies. And it’s not clear what I need to do to trigger the issue.

If you’re able to create a clone that just demonstrates the issue (with steps to reproduce) it’ll make it much easier to help/investigate.

Thanks for the tip, Stu. I don’t have a minimally functional version of the app so it’s a lot of work to create a new one with this page complexity to fix a bug.

Has anything changed in the way Anvil handles data bindings in a material way in the past 6 months? No new development on the app has occurred, so it’s got to be related to an Anvil update that I’m unaware of as it worked perfectly beforehand.

It’s good practice to build the minimal example. It really helps isolate the issue.

In this case it looks like it’s a caching bug with the Row object.
Expect a fix soon.

Edit
This should now be fixed

2 Likes