Skip to content

DOCSP-51959 Add a warning about tryNext bug to all change stream manual iteration examples #1189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 17, 2025

Conversation

mballard-mdb
Copy link
Collaborator

@mballard-mdb mballard-mdb commented Jul 17, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-51959

Staging Links

  • monitoring-and-logging/change-streams
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?
    • Are the page titles greater than 20 characters long and SEO relevant?

    Copy link

    netlify bot commented Jul 17, 2025

    Deploy Preview for docs-node ready!

    Name Link
    🔨 Latest commit aaf19e6
    🔍 Latest deploy log https://app.netlify.com/projects/docs-node/deploys/6879547b307013000858bd82
    😎 Deploy Preview https://deploy-preview-1189--docs-node.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    @docs-builder-bot
    Copy link

    docs-builder-bot commented Jul 17, 2025

    🔄 Deploy Preview for docs-node processing

    Item Details
    🔨 Latest Commit 1ef168a97d66ae756c210fcb327d56be54379c0c
    😎 Deploy Preview https://deploy-preview-1189--docs-node.netlify.app
    🔍 Build Logs View Logs

    Copy link
    Collaborator

    @rachel-mack rachel-mack left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    One suggestion:

    Comment on lines 3 to 6
    The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not
    automatically update the change stream's `resumeToken.
    <{+api+}/classes/ChangeStream.html#resumeToken}>`_ If you require an updated
    ``resumeToken``, use the ``next()`` method.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not
    automatically update the change stream's `resumeToken.
    <{+api+}/classes/ChangeStream.html#resumeToken}>`_ If you require an updated
    ``resumeToken``, use the ``next()`` method.
    The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not
    automatically update the change stream's `resumeToken.
    <{+api+}/classes/ChangeStream.html#resumeToken>`_ If you require an updated
    ``resumeToken``, use the ``next()`` method.

    @@ -88,6 +88,7 @@ read events from the change stream:
    - ``next()`` to request the next document in the stream
    - ``close()`` to close the ChangeStream

    .. include:: /includes/try-next-warning.rst
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    There's a warning below the tabs section on line 117/118 (not this one, but I can't comment directly on it), that I would move into the other tabs, because:

    • I don't think it's only relevant to the Idiomatic Iteration and Event tabs (ask tech review to confirm)
    • It looks a little odd to have two warnings appear in a row

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I believe Iterator mode applies to idomatic and manual iteration, but I will double check as I agree stacking callouts is odd.

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    This is relevant to all tabs because it's a warning not to mix the modes defined in each tab, basically.

    What do y'all think of moving this above the section altogether?

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I can do that, under where it says "read events from change streams by iterating over them or listening for events." The warning can emphasize the or.

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Yeah, I think that works nicely. Thanks

    @mballard-mdb mballard-mdb merged commit 7baddf7 into mongodb:master Jul 17, 2025
    6 checks passed
    @mballard-mdb mballard-mdb deleted the DOCSP-51959-trynext-err branch July 17, 2025 20:01
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    @mballard-mdb
    Copy link
    Collaborator Author

    💔 Some backports could not be created

    Status Branch Result
    v6.17
    v6.16 Conflict resolution was aborted by the user
    v6.15 Conflict resolution was aborted by the user
    v6.14 Conflict resolution was aborted by the user
    v6.13 Conflict resolution was aborted by the user
    v6.12 Conflict resolution was aborted by the user
    v6.11 Conflict resolution was aborted by the user
    v6.10 Conflict resolution was aborted by the user
    v6.9 Conflict resolution was aborted by the user
    v6.8 Conflict resolution was aborted by the user

    Note: Successful backport PRs will be merged automatically after passing CI.

    Manual backport

    To create the backport manually run:

    backport --pr 1189
    

    Questions ?

    Please refer to the Backport tool documentation

    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1191)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit to mballard-mdb/docs-node that referenced this pull request Jul 17, 2025
    …al iteration examples (mongodb#1189)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    @mballard-mdb
    Copy link
    Collaborator Author

    💚 All backports created successfully

    Status Branch Result
    v6.16
    v6.15
    v6.14
    v6.13
    v6.12
    v6.11
    v6.10
    v6.9
    v6.8

    Note: Successful backport PRs will be merged automatically after passing CI.

    Questions ?

    Please refer to the Backport tool documentation

    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1192)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1194)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1195)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1196)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1197)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1193)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1198)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1199)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    mballard-mdb added a commit that referenced this pull request Jul 17, 2025
    …al iteration examples (#1189) (#1200)
    
    * DOCSP-51959 tryNext resumeToken error warning
    
    * fix link
    
    * bracket removal
    
    * move warning
    
    (cherry picked from commit 7baddf7)
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants