diff --git a/pkg/service/objectservice/objectservice.go b/pkg/service/objectservice/objectservice.go index 372ec1b77..1d047acdf 100644 --- a/pkg/service/objectservice/objectservice.go +++ b/pkg/service/objectservice/objectservice.go @@ -7,6 +7,7 @@ import ( "context" "encoding/json" "fmt" + "log" "strings" "time" @@ -108,6 +109,19 @@ func (svc *ObjectService) SetActiveTab(uiContext wstore.UIContext, tabId string) if err != nil { return nil, fmt.Errorf("error setting active tab: %w", err) } + // check all blocks in tab and start controllers (if necessary) + tab, err := wstore.DBMustGet[*wstore.Tab](ctx, tabId) + if err != nil { + return nil, fmt.Errorf("error getting tab: %w", err) + } + for _, blockId := range tab.BlockIds { + blockErr := blockcontroller.StartBlockController(ctx, blockId) + if blockErr != nil { + // we don't want to fail the set active tab operation if a block controller fails to start + log.Printf("error starting block controller (blockid:%s): %w", blockId, blockErr) + continue + } + } return updatesRtn(ctx, nil) }