How to deal with "The file version has been changed" messages

Hello, I have a problem related to the key and document updates handling.

I’ve read about the key usage and how this field is supposed to be generated each time a document is saved, but I don’t know what to do exactly with that key once generated.

First I don’t know if this key is intended to be generated after a document is updated and returned to OnlyOffice in order to be aware of the updated version.

I’ve seen the sample application and I don’t find that the key is used on a save event, only when editing. I’m generating the key using the document FK + modification date, just like the sample. But whereas the sample handles the “wrong version” warning and reloads succesfully, I find that my page gets stuck reloading and showing the warning although documentserver has completed the save callback.

Besides, I see that the sample reloads almost silently (there’s an unharmful error dialog just before reloading) but my page shows the Firefox page reload warning.

I don’t know if I’m missing something: maybe because I’m not using history features, maybe some JS that had to be generated in the edit page. I feel that I’m close to the solution but I’m completely lost.

Thanks.

Hello, I answer my self with a possible solution.

I’ve found out that my modification date uses a resolution of minutes instead of seconds or milliseconds, so it’s not an authentic timestamp. I had seen that I needed a new timestamp field specifically for document versions (my table has other metadata fileds that can be updated separately and so the modification date can be altered while editing) and this aims towards that direction.

Maybe you can confirm if my guess is well founded.
Thank you again.

Hello again. I’ve made the change to a timestamp field and this looks… promising.

The more I thought about it the more I was convinced that it had to be the solution. Anyway, it still shows the Firefox dialog before reloading (the example app could reload directly).

And maybe this belogs to another thread but, what is the usage of the userAddress parameter that appears in the example app?

Hello @rcano

Sorry for the late reply.
I don’t really understand the problem. Are you trying to integrate Document Server with your application?
Please provide a detailed description of what you are trying to achieve.
Also, share the screenshots of Firefox dialog windows that you were referring to.