Skip to content

fix(migrations): don't fail the update over an unloadable sleep-lock unit - #414

Open
duketopceo wants to merge 1 commit into
omacom:quattrofrom
duketopceo:fix-sleep-lock-migration
Open

duketopceo wants to merge 1 commit into
omacom:quattrofrom
duketopceo:fix-sleep-lock-migration

Conversation

@duketopceo

Copy link
Copy Markdown

Summary

Fixes #313.

migrations/1785608166.sh treated a reset-failed error as fatal, but on a unit that never loaded reset-failed is an ordinary no-op — on machines where omarchy-sleep-lock.service was never started (or never packaged — the #310 gap), the update stopped with a misleading "Could not reset" and a pointless retry.

Two changes, matching the conventions already in the tree (omarchy-restart-audio tolerates reset-failed the same way):

  • reset-failed is no longer fatal in either branch; the restart that actually repairs the monitor is what keeps its retry semantics
  • before touching the live manager, the migration checks LoadState — a unit that is not-found or masked has nothing to repair and nothing to restart, so it skips cleanly (a masked unit also shouldn't be force-started over the user's choice)

Failed inspection of LoadState still exits retryable, consistent with the migration's other probes.

Test plan

  • test/shell.d/sleep-lock-environment-migration-test.sh extended: benign reset-failed failure still restarts, not-found/masked units skip without restarting, failed LoadState inspection stays retryable — 12/12 pass

Generated with Devin

…unit

migrations/1785608166.sh treated a reset-failed error as fatal, but on a
unit that never loaded reset-failed is a normal no-op — the update stopped
with a misleading "Could not reset" over nothing. Tolerate it the way
omarchy-restart-audio already does, and skip the live repair entirely when
the manager cannot load the unit (not packaged here, or user-masked): there
is no failed state to clear and nothing to restart. Real inspection,
restart, and stop failures still stay retryable.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@duketopceo
duketopceo force-pushed the fix-sleep-lock-migration branch from 4b1543d to fd3b546 Compare September 12, 2026 03:54
@wesleygrimes wesleygrimes added the cherry-pick-later Port to omacom/omarchy after the overlay merges; match mainline. label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-later Port to omacom/omarchy after the overlay merges; match mainline.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrations/1785608166.sh: reset-failed on a never-loaded unit is fatal, stopping the update with a misleading error

2 participants