-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.3.0
-
Component/s: None
-
None
The current behavior was previously introduced in PHPLIB-335 in 1.3.1, shortly after the introduction of change streams in 1.3.0. While I originally request that change, I'm no longer sure that it makes sense.
In the event of a ResumeTokenException, no document is being returned to the user so there seems little value in incrementing the change stream key. The key itself has no direct relation to the underlying cursor and is merely a sequence for each event document returned during iteration. It seems sensible to only increment it when next() does return a document successfully. That would also be consistent with behavior when an exception is thrown by iterating the underlying cursor (i.e. call to next() on the internal iterator decorating the cursor), as the key is not advanced in that case.
- is related to
-
PHPLIB-335 ChangeStream::next() should increment key even if ResumeTokenException is thrown
- Closed