Let primary summary reads precede optional validation
This commit is contained in:
@@ -44,20 +44,24 @@ class _PipelineDefinitionValidationState
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _load({bool retry = false}) {
|
void _load({bool retry = false}) {
|
||||||
if (widget.source.trim().isEmpty) {
|
final source = widget.source;
|
||||||
|
final gateway = widget.gateway;
|
||||||
|
if (source.trim().isEmpty) {
|
||||||
_result = Future.value({'type': 'validated'});
|
_result = Future.value({'type': 'validated'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final cache = _checks[widget.gateway] ??= {};
|
final cache = _checks[gateway] ??= {};
|
||||||
if (retry) cache.remove(widget.source);
|
if (retry) cache.remove(source);
|
||||||
if (!cache.containsKey(widget.source) && cache.length >= 16) {
|
if (!cache.containsKey(source) && cache.length >= 16) {
|
||||||
cache.remove(cache.keys.first);
|
cache.remove(cache.keys.first);
|
||||||
}
|
}
|
||||||
_result = cache.putIfAbsent(
|
_result = cache.putIfAbsent(
|
||||||
widget.source,
|
source,
|
||||||
() => Future.sync(
|
// Primary summary sections enqueue their reads while mounting. The
|
||||||
() => widget.gateway.call('validate', {'source': widget.source}),
|
// transport serializes replies, so optional validation waits until those
|
||||||
),
|
// reads have been queued. A microtask adds no lingering timer on dispose.
|
||||||
|
() =>
|
||||||
|
Future.microtask(() => gateway.call('validate', {'source': source})),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,3 +34,25 @@ The initial capture attempt used waitfor on a static heading; the kit does not
|
|||||||
index that static label, although the saved PNG visibly showed the warning.
|
index that static label, although the saved PNG visibly showed the warning.
|
||||||
Final captures use screenshots and a real Copy Input interaction instead.
|
Final captures use screenshots and a real Copy Input interaction instead.
|
||||||
No physical device or Safari claim is made here. Nothing was deployed.
|
No physical device or Safari claim is made here. Nothing was deployed.
|
||||||
|
|
||||||
|
## Summary request ordering follow-up
|
||||||
|
|
||||||
|
The integrated application test exposed a real ordering dependency: the shared
|
||||||
|
PipelinesClient serializes each request until its reply. Definition validation
|
||||||
|
was enqueued immediately while its widget mounted, before the schedule section
|
||||||
|
had enqueued `list_schedules`, so a delayed or unanswered optional validation
|
||||||
|
held up primary Summary content.
|
||||||
|
|
||||||
|
Validation now starts in a microtask after synchronous Summary mounting. This
|
||||||
|
lets the schedule request enter the existing transport queue first, without
|
||||||
|
adding a timer or changing the client's serialization contract. The selected
|
||||||
|
source and gateway are captured before deferral, so a later selection cannot
|
||||||
|
change a queued request's source. The application fixture answers the new
|
||||||
|
validation request and asserts that schedules and launch controls are available
|
||||||
|
while validation is still unanswered. No selection, backend or transport code
|
||||||
|
was changed. Focused application/definition-warning tests and analysis are
|
||||||
|
recorded in the follow-up handoff; no full suite or deployment was run here.
|
||||||
|
|
||||||
|
Follow-up result: 149 application/definition-warning tests pass through the
|
||||||
|
memory watchdog (`/tmp/memwatch/out.35VDe8`, peak 2105 MB, 49 s). Focused analysis
|
||||||
|
is clean (`flutter-analyze.NVN15m`).
|
||||||
|
|||||||
@@ -93,10 +93,19 @@ void main() {
|
|||||||
await tester.tap(find.byKey(const Key('pipeline-row-1')));
|
await tester.tap(find.byKey(const Key('pipeline-row-1')));
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
await replyPipelineDetail(tester, channel, fixture);
|
await replyPipelineDetail(tester, channel, fixture);
|
||||||
|
// Optional validation must not get ahead of the Summary's primary read.
|
||||||
|
expect(requestsOf(channel, 'validate'), isEmpty);
|
||||||
await reply(tester, channel, 'list_schedules', 1, {
|
await reply(tester, channel, 'list_schedules', 1, {
|
||||||
'type': 'schedules',
|
'type': 'schedules',
|
||||||
'schedules': <dynamic>[],
|
'schedules': <dynamic>[],
|
||||||
});
|
});
|
||||||
|
await waitForCount(tester, channel, 'validate', 1);
|
||||||
|
// Schedule content and launch controls remain available while the optional
|
||||||
|
// validation response is still outstanding.
|
||||||
|
expect(find.text('Loading schedules…'), findsNothing);
|
||||||
|
expect(find.byKey(runPipelineActionKey), findsOneWidget);
|
||||||
|
expect(find.text('Checking definition…'), findsOneWidget);
|
||||||
|
await reply(tester, channel, 'validate', 1, {'type': 'validated'});
|
||||||
|
|
||||||
await tester.tap(find.byKey(runPipelineActionKey));
|
await tester.tap(find.byKey(runPipelineActionKey));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|||||||
Reference in New Issue
Block a user