Let primary summary reads precede optional validation
This commit is contained in:
@@ -44,20 +44,24 @@ class _PipelineDefinitionValidationState
|
||||
}
|
||||
|
||||
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'});
|
||||
return;
|
||||
}
|
||||
final cache = _checks[widget.gateway] ??= {};
|
||||
if (retry) cache.remove(widget.source);
|
||||
if (!cache.containsKey(widget.source) && cache.length >= 16) {
|
||||
final cache = _checks[gateway] ??= {};
|
||||
if (retry) cache.remove(source);
|
||||
if (!cache.containsKey(source) && cache.length >= 16) {
|
||||
cache.remove(cache.keys.first);
|
||||
}
|
||||
_result = cache.putIfAbsent(
|
||||
widget.source,
|
||||
() => Future.sync(
|
||||
() => widget.gateway.call('validate', {'source': widget.source}),
|
||||
),
|
||||
source,
|
||||
// Primary summary sections enqueue their reads while mounting. The
|
||||
// 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})),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user