Comments (9)
I am sure that the underlying native code works fine, since piping the file stream to process.stdout
works as expected, so the bug must hides in the unzip module's code, I guess it's related to how process.nextTick
is implemented in atom-shell.
It would take me some time to find it out since unzip
has used many third party modules.
from electron.
This bug is again caused by the setImmediate
function.
The unzip
module uses setImmediate
in Parse.prototype._flush
to wait for more data when the file was read but the data was not completely parsed. This trick relies on this behavior: the setImmediate
should run the callback after other uv operations, however since the setImmediate
is implemented via WebKit's setTimeout
, the callback passed would be scheduled to run in WebKit's message loop, which is independent with uv loop, so it happens that the callback passed in setImmediate
just keeps running but the other operations pending in uv loop just do not get a chance to run, until something accidentally activates the uv loop.
Implementing the setImmediate
with node's timers
module would fix this.
The process.nextTick
implementation in atom-shel does have the same problem with setImmediate
, and I doubt atom/atom@70e414b is caused by this. I'll switch both functions to use their original implementations.
from electron.
Fixed with 25d9c1a and electron/node@4b4c40a.
Instead of using node's original implementation of setImmediate
, I just make sure when setImmediate
is called the uv loop would also be activated (or interrupted), so it can have the behavior expected by unzip
module. Using node's setImmediate
would cause interleaves of two message loops and two V8 contexts, which is the thing I want to avoid most.
from electron.
👍 awesome, thanks for the quick fix!
from electron.
Is this something that Ben Noordhuis' changes to node to support multiple
contexts would fix?
On Tue, Jul 9, 2013 at 9:49 AM, Kevin Sawicki [email protected]:
[image: 👍] awesome, thanks for the quick fix!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-20683820
.
from electron.
@nathansobo no, this is caused by our message loop integration, we have to use this solution unless node supports multiple message loops (which I don't think node would ever do, they gave up once when trying to adding isolates to node).
from electron.
Has this been released?
from electron.
Yes it has been released, but I found it only fixed zip files of smaller sizes, there must have been some other bugs.
from electron.
Fixed with electron/node@d0ccec3.
Now atom-shell just uses node's implementation of setImmediate
, otherwise it's quite hard to make unzip
work as expected.
from electron.
Related Issues (20)
- [Bug]: 384khz playbac k HOT 1
- [Bug]: require() doesn't work despite any chsnges HOT 1
- [Bug]: There is an issue with the title bar button HOT 3
- [Bug]: desktopCapturer.getSources is not throwing any error and not returing any thing. HOT 1
- [Bug]: alwaysOnTop property does not work when using screen sharing with microsoft teams on windows. HOT 1
- [Bug]: win.focus() cannot focus and display the window in BrowserWindow
- [Bug]: [65930:0402/195339.772780:ERROR:CONSOLE(1)] "Request Autofill.enable failed. {"code":-32601,"message":"'Autofill.enable' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1) HOT 1
- [Bug]: Cannot get WebGPU adapter in Linux. HOT 5
- [Bug]: When menu item has label equal to `Preferences` word it becomes `Settings...` HOT 1
- [Bug]: 'did-fail-load' is not happening if JavaScript fails to load HOT 3
- Unknown Error While connecting real device with appium inspector HOT 1
- [Bug]: Electron App Hangs HOT 1
- [Bug]: Setting up and clicking on Windows notifications HOT 2
- [Feature Request]: expose process.crashReporter.adExtraParameter to utility processes HOT 1
- [Bug]: Unable to create status tray icon on Windows 10 HOT 2
- [Bug]: contextBridge.exposeInIsolatedWorld with worldId 999 is not exposing the API in isolatedContext (preload.ts file) HOT 3
- [Bug]: An error when trying to install electron-forge HOT 1
- [Bug]: appendSwitch('disable-dawn-features', 'disallow_unsafe_apis') not working HOT 1
- [Bug]: New project Prod build crashes during startup on Apple Silicon HOT 1
- [Bug]: sandboxed electron app fails when running as admin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron.