-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Electron block blob uploads resuld in DisableResponseDecompressionPolicy not available in browser Error #14025
Comments
Thanks for reporting @MGibson1 |
@ramya-rao-a I don't recall this error and I used that API, but I did have When I did run into a different issue in Electron @JasonYeMSFT was a good resource and might be able to know what could be happening. |
@MGibson1
export const isNode =
typeof process !== "undefined" &&
!!process.version &&
!!process.versions &&
!!process.versions.node;
if (isNode) {
// policies only available in Node.js runtime, not in browsers
factories.push(proxyPolicy(pipelineOptions.proxyOptions));
factories.push(disableResponseDecompressionPolicy());
}
Did we miss anything? Adding @jeremymeng for visibility. |
Hi @ljian3377, Thanks for your reply. We do have I'm sorry I'm not sure what would be relevant about the code structure. Could you be a little more specific? In general the intention is to request a SAS-authorized url to a specific blob and upload a file to that blob. This occurs in a One of my coworkers, @Hinton, noticed that in serviceClient there appears to be an option to turn response decompression off. Is that a viable option to fix?
I don't think you missed anything in the node detection, and it does return true in my |
The replacement for browser is specified in core-http package.json
It seems that somehow Electron picked the browser replacement? Though what I read about was that Electron doesn't follow the We could probably change the browser version of |
@MGibson1 Or you can share how to recreate the issue with your repo so @EmmaZhu can recreate it. And this code is in a quite common code path. It should be already hit if there is such an issue. |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
I don't have much knowledge to share here since we don't use the SDK in a browser process and we don't use that flag "DisableResponseDecompressionPolicy" neither. |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Describe the bug
I have code shared throughout multiple typescript repositories which references storage-blob to upload files to a block blob using a URI received from a Server which generates a limited-life blob create URI. In Node and browser environments this code works correctly, but my Electron environment complains that:
Error: DisableResponseDecompressionPolicy is not supported in browser environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Library should correctly upload a file when in electron.
Additional context
The library code I'm using can be found here: https://github.com/bitwarden/jslib/blob/direct-upload-and-download-of-send-files/src/services/send.service.ts#L276-L278. This repository is referenced in multiple clients with the expectation that in each an ArrayBuffer is just uploaded to the given blob URI.
The fact that my code works in both Node and browser-based clients leads me to believe that however storage-blob is detecting if it's in a Node environment is being tricked by Electron to the wrong answer.
Any help or a method to just directly send a PUT request to my blob URL would be fantastic.
The text was updated successfully, but these errors were encountered: