Skip to content

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Sep 18, 2025

The name withTimeout() gives the impression that it would limit the execution of the promise to the given time bound. But that is not the case: it is only the waiting that is limited, and the promise would keep running beyond the time bound.

This PR renames withTimeout() to waitForResultWithTimeLimit() so that developers are more likely to understand the actual behavior of this function.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

The name withTimeout() gives the impression that it would limit the
execution of the promise to the given time bound. But that is not the
case: it is only the _waiting_ that is limited, and the promise would
keep running beyond the time bound.

This commit renames withTimeout() to waitForResultWithTimeLimit() so
that developers are more likely to understand the actual behavior of
this function.
@cklin cklin force-pushed the cklin/rename-withtimeout branch from 0856010 to 8185897 Compare September 18, 2025 15:27
@cklin cklin marked this pull request as ready for review September 18, 2025 17:28
@cklin cklin requested a review from a team as a code owner September 18, 2025 17:28
@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 17:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR renames the withTimeout() function to waitForResultWithTimeLimit() to better clarify its behavior. The function doesn't actually stop promise execution after the timeout - it only stops waiting for the result while the promise continues running in the background.

Key changes:

  • Function rename from withTimeout to waitForResultWithTimeLimit in the implementation
  • Updated all call sites across the codebase to use the new function name
  • Updated test names and comments to reflect the new naming

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/util.ts Renamed the function definition and updated related comment
src/util.test.ts Updated test names and function calls to use new name
src/trap-caching.ts Updated import and function calls
src/overlay-database-utils.ts Updated import and function calls
lib/init-action.js Updated compiled JavaScript with function rename
lib/analyze-action.js Updated compiled JavaScript with function rename

@cklin cklin merged commit 12dda79 into main Sep 18, 2025
592 checks passed
@cklin cklin deleted the cklin/rename-withtimeout branch September 18, 2025 20:34
@github-actions github-actions bot mentioned this pull request Sep 25, 2025
8 tasks
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.

3 participants