Skip to content

src: fix broken fast callback signatures #59055

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Renegade334
Copy link
Contributor

Since #54408, the various fast callbacks that were edited by that PR have broken signatures and have not been invoked. (The changed signatures would only have been valid if the receiver were prepended to the function arguments wherever those bindings were called from JS, which isn't the case.)

There was no debug tracking of these callbacks, so this went unnoticed at the time.

This change fixes the broken signatures and adds debug testing to validate the fast paths.

This effectively reverts the remaining source changes from #54408 that were not already covered by #58054.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/wasi

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jul 13, 2025
@Renegade334 Renegade334 force-pushed the fix-histogram-fast-callbacks branch from d230f2e to 7f27665 Compare July 13, 2025 23:37
Comment on lines -190 to -194
if (value < 1) {
HandleScope scope(options.isolate);
THROW_ERR_OUT_OF_RANGE(options.isolate, "value is out of range");
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

value is validated in the JS layer, so a debug check should be fine here.

@Renegade334 Renegade334 force-pushed the fix-histogram-fast-callbacks branch from 7f27665 to 93048b8 Compare July 13, 2025 23:39
@Renegade334 Renegade334 force-pushed the fix-histogram-fast-callbacks branch from 93048b8 to 9926389 Compare July 14, 2025 00:09
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 75.75758% with 8 lines in your changes missing coverage. Please review.

Project coverage is 90.08%. Comparing base (049664b) to head (9926389).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/histogram.cc 33.33% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59055      +/-   ##
==========================================
+ Coverage   90.06%   90.08%   +0.01%     
==========================================
  Files         645      645              
  Lines      189130   189126       -4     
  Branches    37094    37090       -4     
==========================================
+ Hits       170339   170372      +33     
+ Misses      11511    11466      -45     
- Partials     7280     7288       +8     
Files with missing lines Coverage Δ
src/histogram.h 60.00% <ø> (ø)
src/node_process.h 100.00% <100.00%> (+75.00%) ⬆️
src/node_process_methods.cc 88.69% <100.00%> (+0.88%) ⬆️
src/node_wasi.cc 65.81% <ø> (+1.56%) ⬆️
src/node_wasi.h 0.00% <ø> (ø)
src/timers.cc 96.39% <100.00%> (+8.10%) ⬆️
src/timers.h 100.00% <ø> (ø)
src/histogram.cc 76.65% <33.33%> (+3.90%) ⬆️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants