fix(app): scope pending pipeline runs by endpoint

This commit is contained in:
2026-10-22 23:59:52 +01:00
parent b82bdd327a
commit 2573b49a0d
3 changed files with 59 additions and 3 deletions
+8 -3
View File
@@ -26,6 +26,7 @@ class PipelinesScreen extends StatefulWidget {
const PipelinesScreen({
super.key,
required this.gateway,
this.endpoint = '',
this.embedded = false,
this.syncToken = 0,
this.onRunStarted,
@@ -37,6 +38,9 @@ class PipelinesScreen extends StatefulWidget {
final ApiGateway gateway;
/// Validated websocket endpoint used to isolate stored launch intents.
final String endpoint;
/// True under the application shell, which owns the single navigation bar.
final bool embedded;
@@ -84,7 +88,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
super.initState();
_controller = PipelinesController(
PipelinesRepository(widget.gateway),
pendingRunStore: const SharedPreferencesPendingRunStore(''),
pendingRunStore: SharedPreferencesPendingRunStore(widget.endpoint),
)..load();
final id = widget.initialPipelineId;
if (id != null) {
@@ -96,11 +100,12 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
@override
void didUpdateWidget(PipelinesScreen oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.gateway != widget.gateway) {
if (oldWidget.gateway != widget.gateway ||
oldWidget.endpoint != widget.endpoint) {
_controller.dispose();
_controller = PipelinesController(
PipelinesRepository(widget.gateway),
pendingRunStore: const SharedPreferencesPendingRunStore(''),
pendingRunStore: SharedPreferencesPendingRunStore(widget.endpoint),
)..load();
} else if (oldWidget.syncToken != widget.syncToken) {
// The socket was replaced; re-read through the existing controller so the