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: webContents return type incorrect #38026

Merged
merged 3 commits into from
Apr 24, 2023

Conversation

BlackHole1
Copy link
Member

Description of Change

Some APIs may have undefined return values, but they are not reflected in d.ts.

Before:
image

After:
image

Checklist

Release Notes

Notes: none

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 19, 2023
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/24-x-y PR should also be added to the "24-x-y" branch. target/25-x-y PR should also be added to the "25-x-y" branch. target/23-x-y PR should also be added to the "23-x-y" branch. labels Apr 19, 2023
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BlackHole1 you'll need to update some tests in order to account for new possible null webContents values;

An error occurred while running the spec runner
electron/spec/api-web-contents-spec.ts(495,14): error TS2531: Object is possibly 'null'.
electron/spec/api-web-contents-spec.ts(500,14): error TS2531: Object is possibly 'null'.
electron/spec/api-web-contents-spec.ts(504,14): error TS2531: Object is possibly 'null'.

@dsanders11
Copy link
Member

@BlackHole1, another failing test:

electron/spec/chromium-spec.ts(1949,14): error TS2531: Object is possibly 'null'.

@BlackHole1
Copy link
Member Author

BlackHole1 commented Apr 19, 2023

@dsanders11 I fixed this issue locally before leaving work, but I forgot to push it 🤣 I'll update it when I come back to work tomorrow.

@BlackHole1
Copy link
Member Author

Ci failure has nothing to do with the current PR

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 20, 2023
@jkleinsc jkleinsc merged commit 141f65b into electron:main Apr 24, 2023
@release-clerk
Copy link

release-clerk bot commented Apr 24, 2023

No Release Notes

@trop
Copy link
Contributor

trop bot commented Apr 24, 2023

I was unable to backport this PR to "24-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Apr 24, 2023

I was unable to backport this PR to "23-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/24-x-y needs-manual-bp/23-x-y and removed target/24-x-y PR should also be added to the "24-x-y" branch. target/23-x-y PR should also be added to the "23-x-y" branch. labels Apr 24, 2023
@trop
Copy link
Contributor

trop bot commented Apr 24, 2023

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

@trop trop bot added in-flight/25-x-y and removed target/25-x-y PR should also be added to the "25-x-y" branch. labels Apr 24, 2023
@BlackHole1 BlackHole1 deleted the fix-webContents-type branch April 24, 2023 23:43
BlackHole1 added a commit to BlackHole1/electron that referenced this pull request Apr 25, 2023
* fix: webContents type incorrect

* fix: ci failed

* fix: ci failed 2
@trop
Copy link
Contributor

trop bot commented Apr 25, 2023

@BlackHole1 has manually backported this PR to "24-x-y", please check out #38111

BlackHole1 added a commit to BlackHole1/electron that referenced this pull request Apr 25, 2023
* fix: webContents type incorrect

* fix: ci failed

* fix: ci failed 2
@trop
Copy link
Contributor

trop bot commented Apr 25, 2023

@BlackHole1 has manually backported this PR to "23-x-y", please check out #38112

@trop trop bot added in-flight/23-x-y merged/25-x-y PR was merged to the "25-x-y" branch. merged/24-x-y PR was merged to the "24-x-y" branch and removed needs-manual-bp/23-x-y in-flight/25-x-y in-flight/24-x-y labels Apr 25, 2023
codebytere pushed a commit that referenced this pull request Apr 25, 2023
fix: webContents return type incorrect (#38026)

* fix: webContents type incorrect

* fix: ci failed

* fix: ci failed 2
@trop trop bot removed the in-flight/23-x-y label Apr 25, 2023
codebytere pushed a commit that referenced this pull request Apr 25, 2023
fix: webContents return type incorrect (#38026)

* fix: webContents type incorrect

* fix: ci failed

* fix: ci failed 2
@trop trop bot added the merged/23-x-y PR was merged to the "23-x-y" branch. label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/23-x-y PR was merged to the "23-x-y" branch. merged/24-x-y PR was merged to the "24-x-y" branch merged/25-x-y PR was merged to the "25-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants