What I’m trying to do:
Connect my uplink code to my app. This code was working perfectly yesterday, but from late this afternoon my app seems to have stopped communicating with it.
What I’ve tried and what’s not working:
My uplink code seems to connect. The key is correct and it shows this :
Connecting to wss://anvil.works/uplink
Anvil websocket open
Connected to "Default environment" as SERVER
However, when I try to call a function defined in the uplink scripts I get this exception :
anvil.server.UplinkDisconnectedError
but the uplink code is still running. No errors get displayed uplink side.
Code Sample:
# this is the complete uplink script with the key redacted.
import anvil.server
import auth
import suppliers
import resellers
import smpp_clients
import http_clients
from class_mysql_official import MySQL
anvil.server.connect("REDACTED")
anvil.server.wait_forever()
No errors get displayed uplink side, but none of the functions defined in the imported modules register, either.
The code has been unaltered for days and worked perfectly well until today.
How can I tell what is going on? Where is the uplink connecting to if not the app with the matching key?
Quite critical for me, as most of my apps reply heavily on uplink …
edit - I think I see the issue. The uplink only seems to work to the MASTER branch, whereas I’m editing MAIN-DEV branch.
Can I make the uplink communicate to a different branch? I don’t really want to merge this code yet to the master.
EDIT 2
-------
Ok, I found how to change it (under publishing), now the uplink works again after adding a new environment (and converting my project to use environments) …
BUT …
something must have changed - this was working fine yesterday. I need to know for my sanity if you made an update today please. If not, then something else is wrong.
EDIT 3 - it’s stopped working again. Same issue as before. It started working after my environment change above, but then stopped without me editing a single file.
This is driving me mad. It’s now working 10% of the time. No errors uplink side. Same action in the app (show a list of data from a sql table). Keep clicking the button and some of the time it will return the result, most it will return the uplink disconnected exception. The app is running in the IDE.
EDIT 4
Right, if I go to the private URL, it works every time, but from inside the IDE it fails around 30% of the time. It’s like the IDE is getting confused over which environment to use?
Problem is, I don’t know what to look for.