Skip to content

fix: prevent double callback when maxResponseSize exceeded#1849

Open
hanu-14 wants to merge 1 commit into
forwardemail:masterfrom
hanu-14:fix/max-response-size-double-callback
Open

fix: prevent double callback when maxResponseSize exceeded#1849
hanu-14 wants to merge 1 commit into
forwardemail:masterfrom
hanu-14:fix/max-response-size-double-callback

Conversation

@hanu-14

@hanu-14 hanu-14 commented Jul 18, 2026

Copy link
Copy Markdown

Fixes #1830

When maxResponseSize is exceeded, the data handler calls both
es.destroy(error)\ and \ his.callback(error, null). Since
es.destroy(error)\ emits an error event that can trigger a second callback call, this results in the 'double callback bug' warning.

Fix: Remove the
es.destroy(error)\ error argument and instead just destroy without error emission, letting the explicit \ his.callback()\ call be the single callback path.

@hanu-14 hanu-14 closed this Jul 22, 2026
@hanu-14 hanu-14 reopened this Jul 22, 2026
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.

[fix] "superagent: double callback bug" with maxResponseSize

1 participant