Skip to content

Commit

Permalink
misc: Remove a warning about an unexpected version
Browse files Browse the repository at this point in the history
The warning was long overdue for removal as it didn't reflect how the real editors do versioning (which is said because there's othewise no checksumming to ensure the states are consistent between the client and the server).
  • Loading branch information
artempyanykh committed Dec 9, 2023
1 parent 36b5d57 commit ff0b3c1
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions Marksman/Doc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ module Doc =
>> Log.addContext "newVersion" newVersion
)

// Sanity checking
match newVersion, doc.version with
| newVersion, Some curVersion when curVersion > 0 ->
let expectedVersion = curVersion + change.ContentChanges.Length

if expectedVersion <> newVersion then
logger.warn (
Log.setMessage "Unexpected document version"
>> Log.addContext "uri" doc.id.Uri
>> Log.addContext "currentVersion" curVersion
>> Log.addContext "newVersion" newVersion
)
| _ -> ()

let newText = applyTextChange change.ContentChanges doc.text

{ withText exts newText doc with version = Some newVersion }
Expand Down

0 comments on commit ff0b3c1

Please sign in to comment.