Weird behavior of Custom Widgets... updating the code, but they stay reading the old code

So I am practicing with creating widgets at Github.

I am trying to create a new Cards Widget, and going through a trial and error process, and making several updates, committing the changes and reloading.

After I noticed sometimes my code change didn´t correct the problems, I started to wonder if the widget WAS being updated at Grist.

So I started putting version numbers at the top. And noticed that SOMETIMES, they really don´t update. Not with reload. Not with reload+F5. Not by changing the widget permissions. Etc

Even weirder… look at this

I changed the permissions to only table or none. It shows version 1.4 and I get a warning the widget needs full access

and when I click to ACCEPT… it RETURNS to 1.3!! (now after half an hour, it finally stays at 1.4 after clicking to accept full permissions)

So I tried changing to another widget, reloading, choosing custom widget again, didn´t work. The previous code stood in the memory. Tried restarting the data engine… didn´t work either.

the code file shows as updated on Github. And accessing the URL directly shows the correct version.

So it’s Grist that for some reason, after reading the code, doesn´t reset maybe for a set period of time?

Hi @Rogerio_Penna.

It sounds like there might be some sort of browser-level caching happening. A trick you can do is add ?v=123 to the end of the widget URL to fool the browser into not using the cache. Does it work correctly when you do that?

GitHub Pages does have a delay from when you commit your changes until you see them live, and pages may be cached for up to 10 minutes. The trick above can get you around the cache, but there may still be other delays.

George

I will try it soon. Will post the results later.