Using Same key getting version history issue

at first time login with one user editor is working and again open same document with same user getting one warning issue
“The File version has been changed the page will be reloaded”
after click on okay button , load the document but not editing document only it showing readonly mode

You can find the description of the error here:

I’d strongly recommend installing one of our integration examples that are available here:
This will help you analyze the basic principles of the Document Server integration.

The Document Key will be invalidated after the document getting saved and closed (last user leaves the edit mode of the document).
A forced save the document has not this effect (document is still open).

You can detect this mode in you callback backend with the status:

So don’t use for example the document id of your backend as key. You need something like a unique key for the currently version of your document. For example the document id + the version id that automatically increments on save (but beware of the force save thing).