Review round 2: a media restart no longer starts an app the household stopped (R-721); the file manager's header name file appears whole (R-1100 race, 44/300 -> 0/300); both red-proved; unreleased
gates / gates (push) Successful in 1m22s

This commit is contained in:
2026-10-24 15:26:56 +02:00
parent 321df1f87a
commit b01bb4b88d
8 changed files with 163 additions and 31 deletions
+15 -2
View File
@@ -50,6 +50,19 @@ func (s *Server) mediaApps() []string {
return s.stackMgr.MediaApps()
}
// mediaAppsToRecreate is the list the media restart and the safe removal recreate: every media app except the ones the
// household stopped (R-721) — a recreate would start them; their next start reads the override already written.
func (s *Server) mediaAppsToRecreate(why string) []string {
if s.stackMgr == nil {
return nil
}
recreate, stopped := s.stackMgr.MediaAppsToRecreate()
for _, name := range stopped {
s.logger.Printf("[INFO] [media] %s: NOT recreating %s — the household stopped it; it sees the drives at its next start", why, name)
}
return recreate
}
func (s *Server) presentMediaDrives() []mediawire.Drive {
if s.stackMgr == nil {
return nil
@@ -195,7 +208,7 @@ func (s *Server) MediaNotice(checkStale bool) MediaDriveNotice {
// recreates the file browser, records the restart on every drive, then wires the present drives in.
func (s *Server) restartMediaApps(reason string) []string {
var failed []string
for _, name := range s.mediaApps() {
for _, name := range s.mediaAppsToRecreate("restart (" + reason + ")") {
if s.appHeld(name) {
continue
}
@@ -304,7 +317,7 @@ func (s *Server) mediaSafeRemoval(path, durableID string) []string {
if err := s.settings.SetEjected(path, durableID, paused); err != nil {
s.logger.Printf("[WARN] [media] safe removal %s: recording it: %v", path, err)
}
for _, name := range s.mediaApps() {
for _, name := range s.mediaAppsToRecreate("safe removal " + path) {
if s.appHeld(name) {
continue
}