Skip to content

Commit df4e2eb

Browse files
committed
Only capture operationTime from first aggregate
1 parent 3b28528 commit df4e2eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Operation/Watch.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ final public function commandStarted(CommandStartedEvent $event)
205205
return;
206206
}
207207

208-
$this->operationTime = null;
209208
$this->isFirstBatchEmpty = false;
210209
}
211210

@@ -218,7 +217,9 @@ final public function commandSucceeded(CommandSucceededEvent $event)
218217

219218
$reply = $event->getReply();
220219

221-
if (isset($reply->operationTime) && $reply->operationTime instanceof TimestampInterface) {
220+
/* Note: the spec only refers to collecting an operation time from the
221+
* "original aggregation", so only capture it if we've not already. */
222+
if (!isset($this->operationTime) && isset($reply->operationTime) && $reply->operationTime instanceof TimestampInterface) {
222223
$this->operationTime = $reply->operationTime;
223224
}
224225

0 commit comments

Comments
 (0)