Is your feature request related to a problem? Please describe.
One of the ways use containers to control which accounts are used. For example, I open github in one of 3 different containers depending on which github account I'm using. I open Google websites in one of several containers depending on which Google account I'm using, etc.
I use Groups to organize tasks. For a task, I might have a Google Drive document open on one account, a different Google Drive document open in a different account. One or two github tabs which might be in the same container. A search tab in another container, etc.
When I close the window or select a different group, Simple Tab Groups saves all these tabs, but doesn't save which containers were used. When I later re-open the group to resume that task, the tabs all open in the default container (no container) instead of the container they were opened in when I closed the Window/switched groups.
I don't mind that I have to pick which container to use when I open a brand new tab; that's how the Multi-Accounts containers extension is supposed to be used. But I do mind when I restore a Group and I need to go through and right click every tab to "re-open in container BLAH". sometimes, just from looking at the URL, I can't immediately tell which container was originally using.
Describe the solution you'd like
I would like Simple Tab Groups to keep track of which container each tab is using and restore tabs to the same container.
Describe alternatives you've considered
I've seen suggestions to force a Group to always use a specific container. That doesn't fit my use case. But I think my more general solution mostly solves the problem for those who want the other solution.
I don't quite understand the logic behind which the tab containers are reset

I can reproduce this by repeating the steps in your video above, but closing all Firefox windows before switching to group 2, then re-opening ff.
Here's a screen recording of it: lost-containers.zip
Sorry for including as a zip. For some reason when I tried to record my screen as a gif, the file was larger than 200 MB. I recorded as mp4 instead (2.8 MB), but GitHub does not allow uploading mp4 files :(
https://github.com/Drive4ik/simple-tab-groups/issues/671#issuecomment-705022235
Without a timeline, with the looping, I find it difficult to see the problem in that screen recording (sorry).
I can reproduce a problem, with closure of a second window in the mix, but I'll not attempt to make the steps consistently reproducible.
To me this smells like a bug in Firefox, involving discarding and hiding.
If someone can provide minimal steps to reproduce (STR) it will help to seek a bug in Bugzilla@Mozilla. Thanks.
https://github.com/Drive4ik/simple-tab-groups/issues/671#issuecomment-731784718
@smichel17 can you make things reproducible _without_ the prompts to remember decisions?
Thanks
It's also possible that this is caused by an interaction with the temporary containers extension. I'll see if I can reproduce on a fresh profile.
I'm not very familiar with extension development -- I assume a timeline means a debug log? I'll see if I can record one of those, as well.
Thanks, I meant no timeline in the looping image (GIF?) at https://github.com/Drive4ik/simple-tab-groups/issues/671#issuecomment-705022235
… also possible that this is caused by an interaction with the temporary containers extension. I'll see if I can reproduce on a fresh profile. …
I'm almost certain that my production of the issue was _without_ the Temporary Containers extension. Gut feeling: the issue should be reproducible with Simple Tab Groups and Multi-Account Containers alone. Let's focus on the two-window scenario and closing one of the two at some point.
Good (I think) news: this is totally reproducible on a fresh profile.
https://user-images.githubusercontent.com/6563664/109418991-fff82180-79c2-11eb-8996-b39015d696f4.mp4
One anomaly: The very first time I tried to reproduce this, when closing the first window, it warned me, "Are you sure you want to close two tabs?" but I was only closing one. I checked "never warn me again" before taking this screen recording, but can get a recording with the popup if needed.
I had trouble figuring out what I was supposed to do to get a timeline (I found the firefox timeline, though…). I don't want to spend more time searching now, but will do that if someone gives or links me to instructions.
re: https://github.com/Drive4ik/simple-tab-groups/issues/671#issuecomment-705022235, I find it difficult to see the problem in that screen recording (sorry)
Ah. @grahamperrin I believe the point was that this gif doesn't reproduce the bug, and @Drive4ik was asking for clarification on the steps to reproduce.
Thanks, and I should have been clearer about my meaning of _timeline_ – your recording does have one, in that I can describe this (point at which a loss becomes visible) as at 0:26 on the timeline:

Can you get a Firefox 88.0a1 or greater that was built after the time of the commit below?
If so, please tell whether this is reproducible.
https://hg.mozilla.org/mozilla-central/rev/4d91456f4232 probably not related, but I'd like to rule it out. In any case, a test with a recent nightly Firefox might be useful.
This will be better elsewhere but for now, I'll link to it from here:
– I tested a few such extensions earlier today. The first version of the list comprises just two extensions (Simple Tab Groups and one other); I'll add results from other tests in due course.
In the meantime: I could not produce anything like this issue #671 with anything other than Simple Tab Groups. This is not to conclude that it's a bug in Simple Tab Groups – I still suspect that a fix is blocked by a bug in Firefox (and that if a fix was amongst the recent flurry of activity, it might not reach users of _releases_ of Firefox until late April).
https://wiki.mozilla.org/Release_Management/Calendar#Future_branch_dates
Here's a screenshot of the dialog I mentioned above. Asking about closing 2 tabs, when there's only one open.

… 2 tabs, when there's only one …
In the absence of an API for tab groups, Firefox can not be aware that a groups-oriented extension will do something intelligent with what's grouped and non-grouped when a window closes.
Click Cancel then seek other tabs:

– you might find the one that's not visible.
I'm aware of the "Show other tabs" section and I thought that I'd cleared it out, but I can't currently reproduce the behavior, so it's possible that I missed a tab.
https://github.com/Drive4ik/simple-tab-groups/issues/671#issuecomment-787500008
… suspect that a fix is blocked by a bug in Firefox …
Maybe 1635765 - Open tabs lose container association on restart
Thanks @cesarizu for https://github.com/mozilla/multi-account-containers/issues/1867#issuecomment-781506280