mhttpd restart loses edit fields

Issue #112 resolved
dd1 created an issue

when on the "start run" page, if mhttpd is restarted (or there is a network interruption), the page will reload and all the edit-on-start items will revert to the old values from odb, all edits and changes done by the user are lost. Other pages with editable fields are also affected by this. The recent commit to avoid page reload by checking document.activeElement is ineffective i.e. on the run start page. K.O.

Comments (2)

  1. Stefan Ritt

    Are you sure? I tried it myself and the page did not reload. But maybe that depends how the browser handles the active element. If you go to another window (like the terminal) to stop mhttpd, some browsers might render the current edit box NOT as active (Google Chrome under MacOSX keeps it however as active element, so here it works).

    So let's try something different: I removed the page reload completely. So on every reconnect, I just remove the error message and schedule the refresh update timer. This works on all the pages I tested. But if the users has a custom page which does its own mjsonrpc call periodically, the user then hast to take care to re-establish the periodic update after a reconnect.

  2. Log in to comment