Title: fix(core): stop debounce double-invoking a single leading+trailing call by JosunLP · Pull Request #198 · bQuery/bQuery · GitHub
Open Graph Title: fix(core): stop debounce double-invoking a single leading+trailing call by JosunLP · Pull Request #198 · bQuery/bQuery
X Title: fix(core): stop debounce double-invoking a single leading+trailing call by JosunLP · Pull Request #198 · bQuery/bQuery
Description: Summary Fixes #178 (Low; correctness). With { leading: true, trailing: true }, a single call double-invoked: the leading branch invoked with preservePending = trailing (keeping pendingArgs), then trailingTrigger saw pendingArgs still set and invoked again. One call → two invocations. Fix The leading invoke now clears pendingArgs. A subsequent call within the window re-sets pendingArgs (the leading branch is skipped once leadingDone), so the trailing edge still fires — but only when the function was called more than once, matching lodash semantics. Verification Existing multi-call test (fn(1); fn(2); fn(3) → [1, 3]) still passes. Rewrote the single-call test that previously codified the bug: fn(1) now yields [1], not [1, 1]. It fails on the pre-fix code. function/utils/core suites: all pass. tsc --noEmit clean. 🤖 Generated with Claude Code
Open Graph Description: Summary Fixes #178 (Low; correctness). With { leading: true, trailing: true }, a single call double-invoked: the leading branch invoked with preservePending = trailing (keeping pendingArgs), then t...
X Description: Summary Fixes #178 (Low; correctness). With { leading: true, trailing: true }, a single call double-invoked: the leading branch invoked with preservePending = trailing (keeping pendingArgs), then t...
Opengraph URL: https://github.com/bQuery/bQuery/pull/198
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8c49e93f-0945-0633-b20a-b7b114b19d04 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A72C:35AE45:BD38B6:11695DF:6A4E245E |
| html-safe-nonce | ca18c1175cca38062fabcafa5ed885111d02a1e83b126a5614df7a5c3928b501 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzJDOjM1QUU0NTpCRDM4QjY6MTE2OTVERjo2QTRFMjQ1RSIsInZpc2l0b3JfaWQiOiI4MTM0MDI5NTUzMzg5NDEzNDcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b45c236b17ada8ce52bd49ec7aeabcd88f7568aa737b719839803846997a9b20 |
| hovercard-subject-tag | pull_request:4001210486 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/bQuery/bQuery/pull/198/files |
| twitter:image | https://avatars.githubusercontent.com/u/20913954?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/20913954?s=400&v=4 |
| og:image:alt | Summary Fixes #178 (Low; correctness). With { leading: true, trailing: true }, a single call double-invoked: the leading branch invoked with preservePending = trailing (keeping pendingArgs), then t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width