[BETA] Switching Databases for "Use for development" in IDE

What I’m trying to do:
When in the IDE you have the option to switch databases to “Use for Development” which is indicated by the star next to you different environments.
What I’ve tried and what’s not working:
After switching databases (From Database A to B and Back to A) in the same session, I have to clear my cache, close my browser, or log out/in to activate access to the database again. I am not completely sure which of these three actions resolve the issue.

Here is the error I get:

1 Like

Hello @anthonys,

Thanks for raising this.

I’ve tried to recreate this issue with this simple app:

https://anvil.works/build#clone:6KNEZAX4O7OVTSDU=N5ZTNNLEJP765T5SEQD265SO

Could you provide more detailed recreation steps or post a clone link to an app that demonstrates the problem?

Thanks,
Ryan

1 Like

Just updated your clone link , the issue did not occur until I checked “Keep Server Running”

Here is my clone:

https://anvil.works/build#clone:RBELTBZ4V27DFUNR=X54V5MUIGMVOARXCHN3TI64E

Here is my data base set up (not sure multiple databases clone over):

Here is my environment set up (Published is linked to master):

Here is the error:

I am not sure if it is a combination of having different published branches/accelerated tables/python version or not, but it did not occur UNTIL I checked “Keep Server Running”

Here are the steps , once you created multiple databases:

  1. Run a debug session
  2. Stop the debug session
  3. Select the “New Database” for Development
  4. Run another debug session

Boom! Error should happen :slight_smile:

1 Like

Any Success duplicating the error? This is starting to happen more frequently for me :slight_smile:

Sorry to keep bringing it alive, but this is a real nuisance. Any ability to replicate? @ryan

Hi @anthonys,

I was able to recreate the bug. Thank you for your recreation steps! I also was only able to produce the error with “Keep Server Running”. The same issue occurs when you change the database for any published environments in the “Publish this app” dialog. Right now, you can get around the issue by unticking keep server running before switching then re-enabling it.

I’ll raise the issue internally and update this thread when it’s been fixed.

3 Likes

Thank you for looking into it!

Looks looks like this has been resolved!

Actually, It seems to secretly switch your active branch to “master” , but not change the active branch name.

I notice, none of my updates were coming through when running in the IDE.