mirror of
https://github.com/donlucasx/xscapes.git
synced 2026-10-20 08:43:32 +02:00
SetCurrent wrote run/current before anything had created run/. The error was discarded, so on a fresh machine the first SessionStart hook failed to announce its session and the scape above never bound; the spool created the directory a moment later, so the SECOND session worked, which is why no machine that had run xscapes once ever showed it. Found 2026-09-17 by running the Kimi probes under a state directory that had never existed; the Claude path fails the same way. The first outside tester's first session would have hit it. TestTheFirstSessionOnAFreshMachineIsAnnounced. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
22 lines
824 B
Go
22 lines
824 B
Go
package event
|
|
|
|
import "testing"
|
|
|
|
// The first session on a fresh machine never bound (2026-09-17): SetCurrent
|
|
// wrote run/current before anything had created run/, the error was
|
|
// discarded, and the scape kept polling a pointer that was never there. The
|
|
// spool created the directory a moment later, so the second session worked,
|
|
// and no machine that had run xscapes once could show it.
|
|
func TestTheFirstSessionOnAFreshMachineIsAnnounced(t *testing.T) {
|
|
t.Setenv("XSCAPES_HOME", t.TempDir())
|
|
if got := Current(); got != "" {
|
|
t.Fatalf("a fresh home names a session: %q", got)
|
|
}
|
|
if err := SetCurrent("session_first"); err != nil {
|
|
t.Fatalf("SetCurrent on a fresh home: %v", err)
|
|
}
|
|
if got := Current(); got != "session_first" {
|
|
t.Fatalf("Current after the first SetCurrent = %q, want session_first", got)
|
|
}
|
|
}
|