Inconsistent counter naming: `executeCount` (AsyncBatcher, AsyncQueuer) vs `executionCount` (everywhere else)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 769
- Forks
- 64
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 3
Description
Describe the bug
All sync utilities (Batcher, Queuer, Debouncer, Throttler, RateLimiter) and AsyncRetryer expose an executionCount field in their state, but AsyncBatcherState and AsyncQueuerState alone call the same concept executeCount:
| State interface | Field name |
|---|---|
BatcherState, QueuerState, DebouncerState, ThrottlerState, RateLimiterState |
executionCount |
AsyncRetryerState |
executionCount |
AsyncBatcherState, AsyncQueuerState |
executeCount ← inconsistent |
This looks like an accidental divergence introduced in #54 (where the field was first added) rather than a deliberate distinction. Grammatically executionCount ("number of executions") is also the natural noun compound, consistent with the related maybeExecuteCount fields which are named after the maybeExecute method.
One could argue executeCount was meant to be distinct because it increments at execution start (and doubles as the key for the internal asyncRetryers map / getAbortSignal()), while the sync executionCount increments after completion. However, AsyncRetryerState.executionCount also increments at execution start yet uses the executionCount name — so the async utilities are inconsistent even among themselves, which suggests accidental divergence. If maintainers do consider the start/completion distinction meaningful, it would be worth documenting explicitly instead — either way the current state is confusing.
Proposal
Rename executeCount → executionCount in AsyncBatcherState and AsyncQueuerState (pure rename, no behavior change). Since Pacer is pre-1.0, this could ship as a minor with a changelog note calling out the rename.
Affected:
packages/pacer/src/async-batcher.ts(state field,getAbortSignal(executeCount?)parameter, internals)packages/pacer/src/async-queuer.ts(same)- Framework guide docs referencing
executeCount(async-batching / async-queuing guides for react, preact, solid, angular, vanilla)
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/pacer/src/async-batcher.ts and packages/pacer/src/async-queuer.ts, inspecting the state field, getAbortSignal parameter, and internal references. Update the async-batching and async-queuing framework guide references, then add the proposed changelog note. Done means all affected references use executionCount with no behavior change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100