Ensure that new editors get unique ids #16455
This restores the behavior from when
Description of the Change
With this change, editors opened after restoring the window state will get assigned IDs starting from
An alternative could be to select the lowest available unique ID. This would require a more complicated ID generator, but is certainly possible if a more dense ID space is desirable.
Why Should This Be In Core?
Assuming that editor IDs are supposed to be unique, this is a bug in core.
Packages that look up editor instances by ID will be able to resolve to the correct editor.
I'm not aware of any drawbacks.
The text was updated successfully, but these errors were encountered:
I'm not very familiar with writing jasmine tests, but I gave it a shot. If someone more experienced could provide guidance, I'd be happy to expand this a bit. I would personally prefer a test that actually checks for uniqueness of all IDs after initializing the workspace with a mixture of deserialized and "fresh" editors. The test I wrote is more a test of the exact bug this PR fixes, than protection against future regressions. I confirmed that it fails before this fix and passes after, at least...