feat(settings): stream location discovery settings #752

Merged
admin merged 3 commits from feat/741-location-discovery-stream into dev 2026-10-30 17:20:00 +00:00
Owner

Summary

The location-discovery stream slice for #741, now based directly on dev after #751 was merged. Saved and running location-discovery settings are sent as an authenticated typed shared-state domain, and successful saves notify subscribers only after persistence.

The This Node settings view follows the stream with bounded reconnect backoff, preserves unsaved edits when another client changes settings, and makes a one-shot fallback read when the stream is initially unavailable. Missing Electron-only management metadata is retried on the first healthy stream event; reconnect failures stay silent. No polling or secrets are added to the payload.

Verification

  • go test ./apps/sisyphusd/api
  • npm --prefix apps/sisyphus run typecheck
  • npm --prefix apps/sisyphus test (235 passed)
  • git diff --check

/cc @rvnminers-A-and-N

## Summary The location-discovery stream slice for #741, now based directly on `dev` after #751 was merged. Saved and running location-discovery settings are sent as an authenticated typed shared-state domain, and successful saves notify subscribers only after persistence. The This Node settings view follows the stream with bounded reconnect backoff, preserves unsaved edits when another client changes settings, and makes a one-shot fallback read when the stream is initially unavailable. Missing Electron-only management metadata is retried on the first healthy stream event; reconnect failures stay silent. No polling or secrets are added to the payload. ## Verification - `go test ./apps/sisyphusd/api` - `npm --prefix apps/sisyphus run typecheck` - `npm --prefix apps/sisyphus test` (235 passed) - `git diff --check` /cc @rvnminers-A-and-N
Author
Owner

Refreshed this PR onto the current #751 head, so it no longer carries stale model-profile/lending/files ancestry. The focused API tests, all 235 client tests, typecheck, production build, make lint, actionlint, gofmt and diff checks pass locally. The existing Austin review request is preserved; fresh CI is starting.

/cc @rvnminers-A-and-N

Refreshed this PR onto the current #751 head, so it no longer carries stale model-profile/lending/files ancestry. The focused API tests, all 235 client tests, typecheck, production build, `make lint`, `actionlint`, gofmt and diff checks pass locally. The existing Austin review request is preserved; fresh CI is starting. /cc @rvnminers-A-and-N
Author
Owner

Branch maintenance: GitHub reported a real merge conflict because this branch still carried the pre-refresh #751 history. I transplanted the two Location Discovery commits onto the current #751 head, preserving the location controls and E2E coverage. Local focused API tests, race tests, all 235 renderer tests, typecheck, production build and diff checks pass. The Austin reviewer request is preserved; fresh CI is running. /cc @rvnminers-A-and-N

Branch maintenance: GitHub reported a real merge conflict because this branch still carried the pre-refresh #751 history. I transplanted the two Location Discovery commits onto the current #751 head, preserving the location controls and E2E coverage. Local focused API tests, race tests, all 235 renderer tests, typecheck, production build and diff checks pass. The Austin reviewer request is preserved; fresh CI is running. /cc @rvnminers-A-and-N
rvnminers-A-and-N left a comment
Owner

Thanks Lior. The daemon side looks good: the notify comes after the store write, the auth is the same, and the two-subscriber test reads well.

CI's coverage gate is red on aa7c87c. The uncovered lines are local.go:555-556, the LOCATION_DISCOVERY snapshot error branch. #751 got its own failing-store case, but this domain only gets one in #762, which sits above #753. Could you add that case here so 752 is green on its own?

I think the card can also get stuck read-only. Without metadata, apply sets configurable: false, and the metadata read only retries on a disconnect or a domain error, never once the stream is healthy. If Settings opens while the daemon is still starting, the initial read fails, the reads at reconnect time fail too, and then the stream connects. The controls stay disabled until the next drop. Retrying the metadata read on the first good stream event, while it's still missing, would fix that.

Related: every disconnect now makes a fresh read that toasts on failure, so a node restart toasts at each backoff step. Was that intended, or should reconnect-time failures be silent the way model lending handles them?

Thanks Lior. The daemon side looks good: the notify comes after the store write, the auth is the same, and the two-subscriber test reads well. CI's coverage gate is red on aa7c87c. The uncovered lines are local.go:555-556, the LOCATION_DISCOVERY snapshot error branch. #751 got its own failing-store case, but this domain only gets one in #762, which sits above #753. Could you add that case here so 752 is green on its own? I think the card can also get stuck read-only. Without metadata, `apply` sets `configurable: false`, and the metadata read only retries on a disconnect or a domain error, never once the stream is healthy. If Settings opens while the daemon is still starting, the initial read fails, the reads at reconnect time fail too, and then the stream connects. The controls stay disabled until the next drop. Retrying the metadata read on the first good stream event, while it's still missing, would fix that. Related: every disconnect now makes a fresh read that toasts on failure, so a node restart toasts at each backoff step. Was that intended, or should reconnect-time failures be silent the way model lending handles them?
Author
Owner

Addressed both review points. The LOCATION_DISCOVERY unavailable-snapshot branch now has a direct test in this PR. If the initial management-metadata request fails during startup, the first healthy stream event triggers a one-shot retry; reconnect retries are silent, and known metadata is not fetched repeatedly. No periodic polling was added. The renderer tests, typecheck, production build, and focused API coverage check pass locally; fresh CI is running.

/cc @rvnminers-A-and-N

Addressed both review points. The LOCATION_DISCOVERY unavailable-snapshot branch now has a direct test in this PR. If the initial management-metadata request fails during startup, the first healthy stream event triggers a one-shot retry; reconnect retries are silent, and known metadata is not fetched repeatedly. No periodic polling was added. The renderer tests, typecheck, production build, and focused API coverage check pass locally; fresh CI is running. /cc @rvnminers-A-and-N
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sisyphus/Sisyphus#752