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

enable rule to warn about Buffer constructor usage #7197

Merged
merged 5 commits into from Apr 2, 2019

Conversation

shiftkey
Copy link
Member

@shiftkey shiftkey commented Apr 1, 2019

Overview

As part of testing the rebase flow I kept noticing this warning from within the Dev Tools:

(node:63731) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Screen Shot 2019-04-01 at 2 26 55 PM

This was a warning from our upgrade to Electron 3 (that now uses Node 10) about some API changes in Node core.

Description

Some of the Buffer constructor APIs have been deprecated since Node 10.0 and will likely be removed at a later date:

The reasons why have been outlined in nodejs/node#4660 and a more in-depth writeup in https://github.com/ChALkeR/notes/blob/master/Lets-fix-Buffer-API.md.

It's not something that is keeping me awake at night currently, but seeing it on every launch while I test locally in dev tools has annoyed me enough to address it.

I've enabled the no-buffer-constructor eslint to find anywhere we use this API in the codebase, and I plan to clean these up the violations by swapping them to the recommend APIs.

Release notes

Notes: no-notes

@shiftkey shiftkey added the tech-debt Issues and pull requests related to addressing technical debt or improving the codebase label Apr 1, 2019
@shiftkey shiftkey marked this pull request as ready for review April 1, 2019 21:40
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 1, 2019
@niik niik self-assigned this Apr 2, 2019
@shiftkey
Copy link
Member Author

shiftkey commented Apr 2, 2019

I plan to merge this today once the build goes green, to ensure this goes out with the next beta this week.

@shiftkey shiftkey merged commit 16702da into development Apr 2, 2019
@shiftkey shiftkey deleted the cleanup-security-warning-for-buffer branch April 2, 2019 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review Pull Requests that are ready to be reviewed by the maintainers tech-debt Issues and pull requests related to addressing technical debt or improving the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants