Title: fix(reactive): bound self-triggered effect re-runs instead of recursing by JosunLP · Pull Request #186 · bQuery/bQuery · GitHub
Open Graph Title: fix(reactive): bound self-triggered effect re-runs instead of recursing by JosunLP · Pull Request #186 · bQuery/bQuery
X Title: fix(reactive): bound self-triggered effect re-runs instead of recursing by JosunLP · Pull Request #186 · bQuery/bQuery
Description: Summary Fixes #166 (High). effect(() => { count.value = count.value + 1 }) re-entered its own observer synchronously (outside a batch, scheduleObserver invokes observers directly), recursing until RangeError: Maximum call stack size exceeded. Wrapping in batch() didn't help since the re-write happens during flush when batchDepth is 0. Fix The effect observer gets a re-entrancy guard (per-effect isRunning flag). A self-trigger while running sets reRunRequested and returns; the outer invocation drains re-runs in a bounded do/while loop (MAX_SYNC_RERUNS = 100, Vue-style): Effects that settle (e.g. if (count.value < 5) count.value++) converge silently — final value 5, no warning. True cycles stop after the bound and log cyclic effect update detected instead of crashing the tab. Mutually-recursive effects are covered too: nesting depth stays bounded because the inner trigger only sets a flag. Dispose-during-run semantics are preserved (cleanup still runs via the finally path). Verification Three new tests: unconditional self-write (no throw + warning), settling self-write (converges, no warning), self-write inside batch(). Full suite: 2989 pass / 0 fail. tsc --noEmit clean. 🤖 Generated with Claude Code
Open Graph Description: Summary Fixes #166 (High). effect(() => { count.value = count.value + 1 }) re-entered its own observer synchronously (outside a batch, scheduleObserver invokes observers directly), recursing unt...
X Description: Summary Fixes #166 (High). effect(() => { count.value = count.value + 1 }) re-entered its own observer synchronously (outside a batch, scheduleObserver invokes observers directly), recursing...
Opengraph URL: https://github.com/bQuery/bQuery/pull/186
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c013d326-25e4-eaab-49cb-5a7a2c0da0b1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9E38:1E086E:E300F0:14AC2CD:6A4E2DD1 |
| html-safe-nonce | 8370c2595da57fa41a0ce8e1e02e4c485c654a38f8e8f99e1593f60bed6c2b10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTM4OjFFMDg2RTpFMzAwRjA6MTRBQzJDRDo2QTRFMkREMSIsInZpc2l0b3JfaWQiOiI1OTE5NDgwMTA3MDI2NDkyODgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9bd19e79da82eaef8b3797fce8413efc4bf13148a297cda7122cf3a815c3cd6c |
| hovercard-subject-tag | pull_request:4000936968 |
| 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/186/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 #166 (High). effect(() => { count.value = count.value + 1 }) re-entered its own observer synchronously (outside a batch, scheduleObserver invokes observers directly), recursing unt... |
| 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