Skip to content
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

Start supporting response.writableEnded in transaction's context #3428

Closed
david-luna opened this issue Jun 13, 2023 · 1 comment · Fixed by #3430
Closed

Start supporting response.writableEnded in transaction's context #3428

david-luna opened this issue Jun 13, 2023 · 1 comment · Fixed by #3430
Assignees
Labels
agent-nodejs Make available for APM Agents project planning. good first issue

Comments

@david-luna
Copy link
Member

According to nodejs docs response.finished property is deprecated since: v13.4.0, v12.16.0. There is another property recommended by the docs named writableEnded. Agent is relying on this property to fill the transaction.contex.response.finished field.

Although latest version v20.3.0 still supports it agent should anticipate the removal of that property and use the new one when needed. So some expression like the one below may be enough

context.finshed = res.finished || res.writableEnded
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Jun 13, 2023
@david-luna david-luna added good first issue agent-nodejs Make available for APM Agents project planning. and removed agent-nodejs Make available for APM Agents project planning. labels Jun 13, 2023
@thesixpathguy
Copy link
Contributor

Hi @david-luna, I am interested to work on the issue. Can you please assign it to me?

david-luna pushed a commit that referenced this issue Jul 6, 2023
#3430)

* fix: Start supporting response.writableEnded in transaction's context.

Since response.finished property is deprecated as of the newer node versions and another property i.e. response.writableEnded is currently used in place of it. So start supporting reponse.writableEnded in transcation's context. Also, the change is backward compatible as the respone.finished is not removed yet.
Fixes: #3428
PeterEinberger pushed a commit to fpm-git/apm-agent-nodejs that referenced this issue Aug 20, 2024
elastic#3430)

* fix: Start supporting response.writableEnded in transaction's context.

Since response.finished property is deprecated as of the newer node versions and another property i.e. response.writableEnded is currently used in place of it. So start supporting reponse.writableEnded in transcation's context. Also, the change is backward compatible as the respone.finished is not removed yet.
Fixes: elastic#3428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants