Problem
Your users come back after an unattended restart, such as overnight, and their Global Layout opens without the Workspaces window, or with it empty. A Windows restart doesn’t save layouts, but io.Connect Desktop’s own scheduled restart does.
Explanation
The scheduled restart saves the layout as it stands
A scheduled restart or shutdown can save the Global Layout as it is just before it runs, and if nobody answers its confirmation, it goes ahead after 60 seconds (the default). If someone closed the Workspaces window during the day, the saved layout has no Workspaces window; if they emptied it, it’s saved empty. Saved Workspace layouts aren’t touched.
Almost any change marks the layout as modified until it’s next saved or restored, so this can happen on any machine, not only where someone closed the window. What stops it depends on what set up the schedule.
What to do
Launchpad (the default shell from 9.9): turn its schedules off
Turn off Schedule restart and Schedule shutdown in the Launchpad’s System settings. The Launchpad’s schedules always save, and its Save current on exit setting doesn’t affect them.
To keep a scheduled restart, set it up from one of your apps after turning the Launchpad’s off. Turning it off cancels whatever restart is armed, and while it’s on, the Launchpad re-sends its own on every start.
Toolbar (the default shell before 9.9): recreate the schedules with Save current on exit off
A toolbar schedule saves if Save current on exit was on when the schedule was created, and keeps that choice from then on. Turn the setting off if it’s on (Settings → Layouts). Then, whether or not you changed it, recreate or cancel the schedules under Settings → System.
Your own app: pass discardUnsavedLayoutChanges: true
An app that schedules restarts must pass discardUnsavedLayoutChanges: true, or the scheduled restart saves:
await io.interop.invoke("T42.GD.Execute", {
command: "schedule-restart",
args: { cronTime: "<cron expression>", discardUnsavedLayoutChanges: true }
});
Checking a machine
Look at the cronJobs entry in the user’s io-connect-platform preferences. An armed schedule, whatever created it, saves unless its arguments include discardUnsavedLayoutChanges: true.
Exits started by hand can still save
Exits and restarts started by hand can still save, through the shell’s Save current on exit (on by default in the Launchpad, for its Restart and Shut Down buttons) or when the user picks Save in the shutdown dialog.
Don’t set restoreDefaultGlobalOnStartup: false
Leave restoreDefaultGlobalOnStartup at its default. With no layout restored at startup, the shutdown save writes the layout unconditionally.
Recovering the old layout
The local file store keeps no earlier copy. On io.Manager, it depends on the server’s retention settings. The save replaces the whole layout and doesn’t check whether it’s empty.
Tested on: io.Connect Desktop 9. Reproduced on 9.10.1.1 with a schedule created through the API. The Launchpad and toolbar settings, the app opt-out and the Windows-restart behaviour were checked in the product code (9.10.1.1 and 9.7) but not run.