Skip to content

refactor(sdk): rename getNextStepId to peekStepId for clarity#699

Merged
ParidelPooya merged 1 commit into
mainfrom
refactor/rename-peek-step-id
Jul 8, 2026
Merged

refactor(sdk): rename getNextStepId to peekStepId for clarity#699
ParidelPooya merged 1 commit into
mainfrom
refactor/rename-peek-step-id

Conversation

@ParidelPooya

Copy link
Copy Markdown
Contributor

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.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

`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
ParidelPooya marked this pull request as ready for review July 8, 2026 17:19
@ParidelPooya
ParidelPooya merged commit 53b3201 into main Jul 8, 2026
28 of 29 checks passed
@ParidelPooya
ParidelPooya deleted the refactor/rename-peek-step-id branch July 8, 2026 17:52
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.

2 participants