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

fix: optional postMessage transfer arg #32433

Merged
merged 1 commit into from Jan 13, 2022
Merged

Conversation

codebytere
Copy link
Member

Description of Change

Closes #32427.

Fixes an issue where attempts to use ipcRenderer.postMessage without the ostensibly optional transfer argument would throw TypeError: Invalid value for transfer. This was happening because absl::optional value checks consider undefined a value, so we were incorrectly trying to convert undefined into an array of transferrable objects. This is fixed by checking explicitly for transfer being undefined.

Checklist

Release Notes

Notes: Fixed an issue where ipcRenderer.postMessage would throw errors when the transfer argument was not passed.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/14-x-y labels Jan 12, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 12, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 13, 2022
@codebytere
Copy link
Member Author

Failure not relevant:

tag loads devtools extensions registered on the parent window

is a known flake.

@codebytere codebytere merged commit 6c88e3b into main Jan 13, 2022
@codebytere codebytere deleted the fix-optional-transfer-arg branch January 13, 2022 13:52
@release-clerk
Copy link

release-clerk bot commented Jan 13, 2022

Release Notes Persisted

Fixed an issue where ipcRenderer.postMessage would throw errors when the transfer argument was not passed.

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

I have automatically backported this PR to "14-x-y", please check out #32457

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

I have automatically backported this PR to "15-x-y", please check out #32458

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

I have automatically backported this PR to "17-x-y", please check out #32459

@trop
Copy link
Contributor

trop bot commented Jan 13, 2022

I have automatically backported this PR to "16-x-y", please check out #32460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ipcRenderer.Postmessage optional transfer parameter is not actually optional.
4 participants