[cloud functions] Only store "active_failures" status on final chunk

Change-Id: Ib9d6823bb58c57bbb39c203dd444f2b9690889cb
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/131860
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/functions/node/firestore_impl.dart b/functions/node/firestore_impl.dart
index 355bd42..b9ef221 100644
--- a/functions/node/firestore_impl.dart
+++ b/functions/node/firestore_impl.dart
@@ -356,7 +356,7 @@
         'processed_chunks': processedChunks + 1,
         'success': (data['success'] ?? true) && success,
         if (completed) 'completed': true,
-        if (activeFailures) 'active_failures': true
+        if (completed && activeFailures) 'active_failures': true
       });
       transaction.update(document, update);
     }