slub / ocrd_manager

frontend for ocrd_controller and adapter towards ocrd_kitodo
MIT License
11 stars 3 forks source link

Port ocrdbrowser server to ocrd-manager #33

Closed SvenMarcus closed 1 year ago

SvenMarcus commented 1 year ago

Ports my approach to a multi user ocrd browser to the ocrd_manager project. While it's a start, there are still things that require more work:

markusweigelt commented 1 year ago

TBH I am not sure at what time the app even gets to know when the session can be closed.

One possible solution would be the following:

We could create an endpoint that can be triggered. If this endpoint is not triggered then the session expires/can be closed after a preset time e.g. 10 minutes. If this endpoint is triggered the time is reset and runs backwards again.

In the browser the endpoint is triggered by a JavaScript heartbeat. This means that every e.g. 10 seconds an event is triggered. If the user was active in the browser then the endpoint is triggered.

bertsky commented 1 year ago

@markusweigelt Sounds good to me! Feel free to add it here.

bertsky commented 1 year ago

@markusweigelt I still had to fix one more problem (recursive paths did not survive in the request).

I also added a kill command so that when you close the ocrd-browser window, its corresponding broadwayd instance will be closed, too. But that still does not address the lifetime issues (when is .stop() supposed to be called? how should the port be freed if the subprocess exited?).

Also, when opening a workspace, sometimes the background daemon/window does not get set up fast enough. So the web browser shows an empty page and does not automatically refresh it.