Remove DocState::LocallyCreatedButNotEdited #66
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main reason to remove this is that it's a bit of a footgun. If you don't save or announce documents until some changes have been made then the user has to keep track of whether they have made changes before they know if it's safe to share the document ID with other peers. A concrete example of this which we encountered in the JS implementation was a tab creating a document on startup and putting the ID of the document in the URL. This meant that if you copied the URL to another tab but the first tab hadn't made any changes then the second tab just hung forever.
Empty documents take up a tiny amount of space, it seems worth trading that very small amount of extra space to avoid the user having to keep track of whether they have made changes to a document before they can advertise it's ID.