Continuing the discussion from Sneaky Anvil Updates:
Very good to know, @meredydd. Thanks! I won’t go down that route.
Is that
- one branch per App? Or
- one branch, period (i.e., only one App open at a time)?
(I’m on the Professional Plan.)
It matters, because I sometimes leave the IDE open overnight at work. (Unfinished business. The browser keeps my work-in-progress exactly as I left it – all relevant IDE tabs open, cursors positioned, etc.)
If I then have to log in from home, to work on a different App (e.g., emergency fix), I don’t want that to screw things up.
If it’s #2, then I’m better off closing the IDE overnight, just in case.
Edit: Then again, the emergency might imply working on the same app. So, I ought to have closed the IDE, anyway.
1 Like
One branch per app! It’s a consequence of the fact that your development environment for a given app is pointing at one branch/commit at a time.
And don’t worry about screwing things up - Anvil isn’t about to randomly overwrite things! You’ll just see strange effects if you have two editors open on different branches of the same app (mostly with launching the wrong version of the app when you hit Run, or if you refresh)
2 Likes
I think I get it. Here’s what I’m inferring:
No matter how many IDE instances – what I think of as development environments – I have open at the same time, there is, underneath them all, only one formal Environment (Deployment Environments) which is defined as the Development Environment, and that underlying definition is shared by all the IDE instances.
That Development Environment “points at” one branch at a time. (At most one branch.) The act of choosing a branch, in any IDE instance’s Version History tab, is what sets that pointer.
Whichever IDE instance I used to set that branch, that instance is up-to-date.
The other IDE instances, having cached that information, may be out-of-sync, pointing to different branches, having obsolete copies of source code and other settings, etc., until they get back in sync.
Of course, an out-of-sync cache can produce all sorts of nonsense. An instance can be forced back into sync by refreshing its browser tab.
Only one instance can be “most-recently-sync’d”, so that’s the one to rely on.
Do my inferences match up with the implementation?
That intuition roughly matches our current implementation, yes, but we reserve the right to change it 
1 Like
Of course! And I very much appreciate your staying up late to answer.
When our mental models need to change, just let us know what the new model should be.