File rename and Version restore doesn’t work, the project is a spring project downloaded from the official website

I downloaded the demo of spring from the official website, and found two problems after running it:

  1. The file name cannot be changed. After closing the document and opening it again, the old file name is still the same, and the local file name has not changed.

  2. The version cannot be rolled back. I added the code as shown in the picture according to the guidance of the document, and the rollback button appeared, but it didn’t work.

Here is the full code:

config.events['onRequestRename'] = onRequestRename;

config.events['onRequestRestore'] = function (event) {
    console.log(event)
    docEditor.refreshHistory(JSON.parse(hist));
};
var onRequestRename = function(event) { //  the user is trying to rename file by clicking Rename... button
    innerAlert("onRequestRename: " + JSON.stringify(event.data));
    var newfilename = event.data;
    var data = {
        newfilename: newfilename,
        dockey: config.document.key,
        ext: config.document.fileType
    };
    let xhr = new XMLHttpRequest();
    xhr.open("POST", "rename");
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.send(JSON.stringify(data));
    xhr.onload = function () {
        innerAlert(xhr.responseText);
    }

The back-end code for file rename is not screenshotted, because the code in the official demo is completely used.

The docker log reports an error, but this error seems to have nothing to do with the problem:

2023-08-24T13:36:50.347599064Z 2023/08/24 13:36:50 [error] 7317#7317: *351 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 192.168.1.100, server: , request: "GET /7.4.0-163/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "192.168.1.100:5678"
2023-08-24T13:36:58.060146231Z 2023/08/24 13:36:58 [error] 7317#7317: *351 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 192.168.1.100, server: , request: "GET /7.4.0-163/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "192.168.1.100:5678"
2023-08-24T13:37:17.409463025Z 2023/08/24 13:37:17 [error] 7317#7317: *351 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 192.168.1.100, server: , request: "GET /7.4.0-163/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "192.168.1.100:5678"

Other functions are fine. I like the product of onlyoffice very much. Please help me to find out if this is a bug or what I did wrong, thanks!

Document Server version: 7.4.0.163
Type of installation of the Document Server (docker, deb/rpm, exe)
OS: docker
Browser version: Chrome-116.0.5845.110

Hello @zima

Did you download it from Language-specific examples page? If yes, please refer to this page on GitHub to download and install a bit newer version of the Java Spring test example:
https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java-spring

Also, note that there is a newer version of Document Server available too.