Service Workers - Background Sync #147
Unanswered
Coastline23
asked this question in
Q&A
Replies: 1 comment
-
thanks for reporting, I'll take a look at some point |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @s-cork,
You gave me an example app a while back to demonstrate how I might implement Background sync on a messaging app using Anvil Labs Service Workers https://anvil.works/forum/t/js-anvil-call-error-anvil-is-not-defined/16968/4?u=apearce
This appeared to work as required but I have not implemented it until now.
I have finally returned to this part of my app but I'm having issues with the example app.
It sometimes works:
But then, seemingly arbitrarily, subsequent messages just stop at the anvil server call 4).
app log:
processing appears to stop at that point. it does not produce any console/log errors nor does it return processing to the remaining Service worker Code to clear messages from indexed db. It just appears to stop dead at the anvil server call.
The problem is intermittent but repetative. I can run it successfully just once, or many times but then it just stops working.
It also threw a strange import error at one point:
This was with no change to the code. I restarted the app and the error was gone.
I'm stuck! any ideas?
here's a clone to my slightly amended version of your example app. Just added a datetime to the message and code to store the message in the apptable.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions