refactor(sdk): rename getNextStepId to peekStepId for clarity#699
Merged
Conversation
`getNextStepId()` returns `_stepCounter + 1` without advancing the counter, so at operation boundaries (before the current operation has claimed its ID via createStepId) it actually resolves to the CURRENT pending operation's step ID, not a later one. The "next" name obscured this and caused confusion about the replay-mode boundary check (issue #586). Rename it to `peekStepId()` to pair with `createStepId()`: "create" mints the next ID and advances the counter, "peek" returns what the next mint would be without advancing. Also rename the `nextStepId` / `nextStepData` locals at the mode-management call sites to `pendingStepId` / `pendingStepData`, the injected `getNextStepId` parameter in the wait-for-callback handler, and the related comments. This is a naming-only change to private/internal members with no behavioral or public API impact. It does not change the current-vs-next step lookup semantics discussed in #586.
ParidelPooya
marked this pull request as ready for review
July 8, 2026 17:19
ayushiahjolia
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getNextStepId()returns_stepCounter + 1without advancing the counter, so at operation boundaries (before the current operation has claimed its ID via createStepId) it actually resolves to the CURRENT pending operation's step ID, not a later one. The "next" name obscured this and caused confusion about the replay-mode boundary check (issue #586).Rename it to
peekStepId()to pair withcreateStepId(): "create" mints the next ID and advances the counter, "peek" returns what the next mint would be without advancing. Also rename thenextStepId/nextStepDatalocals at the mode-management call sites topendingStepId/pendingStepData, the injectedgetNextStepIdparameter in the wait-for-callback handler, and the related comments.This is a naming-only change to private/internal members with no behavioral or public API impact. It does not change the current-vs-next step lookup semantics discussed in #586.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.