| Index: pkg/barback/lib/src/asset_node.dart
|
| diff --git a/pkg/barback/lib/src/asset_node.dart b/pkg/barback/lib/src/asset_node.dart
|
| index 36a3a669801a37d58068088136fb571ad3abe5e1..16aff4064f4aabd006e910c6d5718128f1346f71 100644
|
| --- a/pkg/barback/lib/src/asset_node.dart
|
| +++ b/pkg/barback/lib/src/asset_node.dart
|
| @@ -58,9 +58,10 @@ class AssetNode {
|
| /// lazy.
|
| Function _lazyCallback;
|
|
|
| - /// Whether this is lazy and needs [force] to be called before it will be
|
| - /// marked available.
|
| - bool get isLazy => _lazyCallback != null;
|
| + /// Whether this asset's transform is deferred.
|
| + ///
|
| + /// See [TransformNode.deferred].
|
| + bool get deferred => transform != null && transform.deferred;
|
|
|
| /// A broadcast stream that emits an event whenever the node changes state.
|
| ///
|
| @@ -195,9 +196,14 @@ class AssetNodeController {
|
| /// Marks the node as [AssetState.DIRTY].
|
| void setDirty() {
|
| assert(node._state != AssetState.REMOVED);
|
| - node._state = AssetState.DIRTY;
|
| node._asset = null;
|
| node._lazyCallback = null;
|
| +
|
| + // Don't re-emit a dirty event to avoid cases where we try to dispatch an
|
| + // event while handling another event (e.g. an output is marked lazy, which
|
| + // causes it to be forced, which causes it to be marked dirty).
|
| + if (node._state.isDirty) return;
|
| + node._state = AssetState.DIRTY;
|
| node._stateChangeController.add(AssetState.DIRTY);
|
| }
|
|
|
|
|