openwork icon indicating copy to clipboard operation
openwork copied to clipboard

bug: startupPref seesaw bug — engine and server can't both work simultaneously

Open pedrohx26 opened this issue 8 months ago • 1 comments

Summary

OpenWork has multiple startup modes controlled by overlapping localStorage keys (startupPref, engineRuntime, engineSource, modePref). When these are set incorrectly or inconsistently, only one of the engine or the server connection works — never both. Switching between modes leaves stale keys that conflict with the new mode.

To Reproduce

  1. Launch OpenWork — works correctly with startupPref=local
  2. UI (or an update) changes startupPref to server
  3. Restart OpenWork — engine doesn't start, server connection fails
  4. Change back to local — stale engineSource / modePref keys conflict
  5. Neither engine nor server works reliably

Expected behavior

  • Startup mode changes should be atomic — all related keys updated together
  • If the configured mode fails, OpenWork should fall back gracefully
  • Conflicting/stale localStorage keys should be cleaned up automatically
  • Ideally, reduce the number of overlapping keys that control the same behavior

Actual behavior

Engine and server enter a seesaw state: fixing one breaks the other. Stale keys from previous modes persist and cause silent conflicts. The user has no visibility into which keys are wrong or how to fix them.

OW version & Desktop info

  • OpenWork: 0.11.194-1 (AUR)
  • OS: Arch Linux x86_64

Additional context

Workaround: force stable preferences on every launch via direct localStorage manipulation:

UPDATE ItemTable SET value=X'6c006f00630061006c00' WHERE key='openwork.startupPref';      -- "local"
UPDATE ItemTable SET value=X'640069007200650063007400' WHERE key='openwork.engineRuntime';  -- "direct"
DELETE FROM ItemTable WHERE key IN ('openwork.engineSource', 'openwork.modePref', 'openwork_mode_pref');

pedrohx26 avatar Mar 30 '26 17:03 pedrohx26

closed due to age, please reopen and tag me if still valid

OmarMcAdam avatar Oct 28 '26 22:10 OmarMcAdam