I've sometimes gotten into this, but haven't been able to reliably reproduce. The lock state gets all funky where I can't ever seem to get back into the sane lock state system with power button, and often this is coupled with permanent blinking purple leds. Even a 'logout' or 'togglewm' fails to fix it.
I suspect there are two cases where this happens: (1) wakeups from rtcwake cronjobs (2) wakeups from plugging power in/out
Recently, we almost were able to reliably reproduce it with #2 (plugging power in and out). Some combination of plugging power in/out and hitting power button caused it for me, and I was able to get into the state a couple times (but not reliably). While there I noticed that the code
periodic_blink sxmo_run_periodically.sh 2 sxmo_uniq_exec.sh sxmo_led.sh blink red blue
was running in ps output even after clicking on 'Logout'. Which is very strange since logout calls sxmo_daemons.sh stop all, which is what should launch the blink and kill it.
Anyway, starting this issue since others have also observed it, so we can track it.
What we really want are steps to reproduce it reliably
Not sure if it's the same reason or even related, but since I updated my PinePhone to tow-boot and I power up with non-os containing but bootable microSD inserted the LED is behaving just as described. Don't have any logs, though. But maybe some part of the OS-relevant file system is still sleeping and cannot be read?
I would like a flock to avoid triggering both state change hook at the same time. I wouldn't be perfect but it would at least prevent inconsistent states. I dunno if this really cause the issue you reported here cause you mention usb power which should cause state changes