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

feat: improve callback value for webContents.print() #19000

Merged
merged 2 commits into from Jul 1, 2019

Conversation

@codebytere
Copy link
Member

codebytere commented Jun 27, 2019

Description of Change

Resolves #18980.

Adds granularity to the optional callback in webContents.print() by adding a failureType value in addition to the success boolean that differentiates between cancelled and failed print jobs.

Tested with this repo.

cc @deepak1556 @brenca

also cc @popod as i know you're tracking printing work :)

Checklist

Release Notes

Notes: Improved webContents.print() callback value to distinguish between success, failure, and cancellation.

@codebytere codebytere requested a review from electron/wg-upgrades as a code owner Jun 27, 2019
@codebytere codebytere requested review from brenca and deepak1556 Jun 27, 2019
@popod

This comment has been minimized.

Copy link
Contributor

popod commented Jun 27, 2019

Thanks you for your nice work ! and yep I'm tracking printing fixes ;)

I think this is a "little" breaking change and that it should be indicated in the release notes.

  • with older electron versions webContents.print() return false in case of errors
  • with newer electron versions webContents.print() return failed which could be interpreted as true (but we attempt to have false with older electron logic)
@codebytere

This comment has been minimized.

Copy link
Member Author

codebytere commented Jun 27, 2019

@popod yeah, this wouldn't be backported and the upcoming change (in v7) would be indicated in notes and code as ability permits!

Copy link
Member

MarshallOfSound left a comment

This is a breaking change, can we instead have like a failureReason or errorType style parameter?

@popod

This comment has been minimized.

Copy link
Contributor

popod commented Jun 27, 2019

Just for information: @MarshallOfSound proposal would solve #15568 too.

And why not backporting this to v6 which is still in beta for now ? sorry for my dummy question ;)

@MarshallOfSound

This comment has been minimized.

Copy link
Member

MarshallOfSound commented Jun 27, 2019

And why not backporting this to v6 which is still in beta for now

@popod We follow semver and this being a feature would be semver/minor, they can't be backported to stable release lines. Admitting a feature to an existing beta release line requires a discussion + good reasoning + a vote in the Releases WG. With 6 so close to the end of its beta cycle it's unlikely any more features will be admitted to destabilization.

@codebytere codebytere force-pushed the better-printing-callback branch from 4d013f2 to 5c2733f Jun 27, 2019
@codebytere codebytere requested a review from MarshallOfSound Jun 27, 2019
patches/chromium/printing.patch Outdated Show resolved Hide resolved
@electron-cation electron-cation bot removed the new-pr 🌱 label Jun 28, 2019
@codebytere codebytere force-pushed the better-printing-callback branch 3 times, most recently from 050ef09 to 71ed8ff Jun 28, 2019
@codebytere codebytere force-pushed the better-printing-callback branch from 71ed8ff to a81497f Jun 28, 2019
@codebytere codebytere requested a review from zcbenz Jun 28, 2019
@zcbenz
zcbenz approved these changes Jul 1, 2019
@codebytere codebytere merged commit 21d04ed into master Jul 1, 2019
13 checks passed
13 checks passed
Artifact Comparison Changes Detected
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20190628.20 succeeded
Details
electron-arm64-testing Build #20190628.20 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

release-clerk bot commented Jul 1, 2019

Release Notes Persisted

Improved webContents.print() callback value to distinguish between success, failure, and cancellation.

@codebytere codebytere deleted the better-printing-callback branch Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.