After months away spinning blue is part of all of my apps

I am building for my school the same app I had last year. I noticed in all of my apps the blue spinner does not go away. All apps are functional. Do I need to add the _s top silence them? This seems like a band-aid not a fix. I have no timer server call. All I am doing is verifying users in a data table or getting table entries for sections of users. Is it possible that this is an issue with my personal internet connection? Has anyone had such an issue?

Thanks in advance

Hi Travis,

The blue spinner indicates that a server function is running (or a table operation is running). Can you work out which server call(s) your app is making, and why they keep running? Eg do you perhaps have a timer (or a loop) constantly polling a database or a server function? Is there one call that’s taking a really long time?

Is seems to be doing this with every call and even allows me to use my app while the spinner is spinning. It also seems to be that the call is done. The panel is updated and I can click on items in it.

It’s definitely not showing the spinner forever after every call (at least, not on our apps or anyone else’s we’ve seen lately). Can you send us an “Allow someone else to copy my app” link so we can see the source? (Find it under the Sharing option on the gear menu)

Alternatively, save a version of your app in the Version History (so you can go back to it), and then systematically remove (or transform to call_s()) all of your server calls, until you find the one that’s keeping the spinner alive.

Here is the Copy my app key. I am currently going through the server calls and replacing with s. Is it possible that this is because I am trying to use a global module?

https://anvil.works/ide#clone:UKSJ53FVVVPA2ZS6=63YEPHD4CKUOHDUFEGBFPSZJ

I guess since a global module is not a server module it would not cause the spinner

The problem is in your store_link_show method:

  def store_link_show (self, **event_args):
    # This method is called when the column panel is shown on the screen
    email = anvil.users.get_user()['email']
    if email is not None:
      print 'echo!'
      self.store_link.visible = True

It’s bound to show of store_link, so it runs when store_link becomes visible. But it also sets store_link to become visible. So it gets into an infinite loop of calling itself. I’ve added print 'echo!' to it and I get this in the Output:

echo!
echo!
echo!
echo!
echo!
echo!
echo!
echo!
... and so on ...

If you modify the method to account for whether the store link is visible yet, the infinite spinning stops:

  def store_link_show (self, **event_args):
    # This method is called when the column panel is shown on the screen
    email = anvil.users.get_user()['email']
    if email is not None and not self.store_link.visible:
      self.store_link.visible = True

Here’s the fixed app:

https://anvil.works/ide#clone:44NSRSOHRGPKKVUR=JMUUEFB5C22BOU7UDTCKJWIX

Thanks a million. Any idea why the loop of a button visibility was triggering the server spinner

The get_user method gets a row from the users table, so it does indeed access the server. Not necessarily every time you run it - it may be cached. But it displays the spinner as one of the first things it does. Normally it’s so quick you don’t see the spinner, but running it on an infinite loop keeps the spinner running.

The fact that it access the Data Tables is mentioned in the autocompleter help for get_user … but I’ve just noticed it’s not made clear in the reference docs, so I’ll change them.