-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: writeBinaryFile to call the correct command (fix #1133) #1136
Fix: writeBinaryFile to call the correct command (fix #1133) #1136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just please shorten the changefile and then will merge and kickoff a release. Thanks for tracking this down!
I have reviewed this code and accept that the commits weren't signed. In the future, @zakpatterson, please consider signing commits with gpg. |
Also happy to set that up and force push new commits if you want to give me a few minutes. |
Sure, will wait for you to force-push. Thanks @zakpatterson ❤️ |
Fixes tauri-apps#1133 writeBinaryFile was reusing writeFile, which was happily saving base64 encoded strings to the fs. This instead uses the correct WriteBinaryFile command, which base64 decodes. However why are we encoding and then decoding, why can we not just send a raw byte array to be saved as a file? This is left for a later PR.
a2b140f
to
13a15fe
Compare
Better? |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
Fixes #1133.
Fix writeBinaryFile in the js api to call the correct function on the rust side. Before, files were sent in base64 encoding, but the save-as-text
WriteFile
fs command was reused, without any indication that the contents were base64 encoded. So the WriteFile command had no way of checking and decoding when necessary. WriteBinaryFile on the rust side expects a base64 encoded string, then decodes it.