-
Notifications
You must be signed in to change notification settings - Fork 22
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
Transcript editor + Electron crashes the app (white screen) #4
Comments
Interesting. I wonder if there's some leaky behaviour somewhere that we can look into - i.e. managing state better so not to create too many copies of the transcript... I wonder if we could also increase the storage cap to prevent maxing out |
I think there's already only one copy of the transcript, but yes, re thinking (perhaps even removing) the save to local storage might be a "quick fix". eg there could be a utility to help with saving to local storage, but the logic and responsibility for that could perhaps leave outside of the component? and for this integration with electron could be removed from the client, and just save directly to disk etc.. Overall, the main problem, from what I read, it might be to do with the render process crashing in electron. Which might be to do with local storage maxing out in electron (?) so it might be worth adding this code as explained here electron/electron#2357 (comment) process.on('uncaughtException', (err) => {
console.log(err);
}); altho not sure, if this is added in the main process, render process or both? |
I tried this
So with that info I also tried the following.
...
"devDependencies": {
"cross-env": "^5.2.0",
- "electron": "^5.0.6",
+ "electron": "1.6.10",
"electron-builder": "^20.38.5",
...
small caviat, because earlier version of electron does not support ES6 out of the box, the UI of DPE client raises an error around the use of spread operator, but you can open the settings window instead. And try it there. In the mac bar,
altho after waiting a few seconds, it still only returns |
Tried with latest electron, I think it might be good to explore something like this, like adding winston to get a log of what's actually going on before it disconnects Also tried with electron demo app |
in app.on('renderer-process-crashed', function(event) {
console.log('renderer-process-crashed', event);
});
paste code from earlier comment #4 (comment) into console once the dev tools get disconnected in main terminal you get {
preventDefault: [Function: preventDefault],
sender: WebContents {
webContents: [Circular],
history: [
'file:///Users/passarellip/CODE/PERSONAL/DPE/digital-paper-edit-electron/node_modules/@bbc/digital-paper-edit-client/index.html#/'
],
currentIndex: 0,
pendingIndex: -1,
inPageIndex: -1,
_events: [Object: null prototype] {
'navigation-entry-commited': [Function],
'-ipc-message': [Function],
'-ipc-message-sync': [Function],
'pepper-context-menu': [Function],
'desktop-capturer-get-sources': [Function],
'remote-require': [Function],
'remote-get-global': [Function],
'remote-get-builtin': [Function],
'remote-get-current-window': [Function],
'remote-get-current-web-contents': [Function],
'remote-get-guest-web-contents': [Function],
crashed: [Function],
'-did-get-response-details': [Function],
'-did-get-redirect-request': [Function],
'devtools-reload-page': [Function],
'-new-window': [Function],
'-add-new-contents': [Function],
'will-navigate': [Function],
'did-navigate': [Function],
destroyed: [Function],
'devtools-opened': [Function],
move: [Function],
activate: [Function],
'page-title-updated': [Function],
'render-view-deleted': [Function: listener]
},
_eventsCount: 25,
_maxListeners: 0,
browserWindowOptions: {
width: 1000,
height: 670,
minWidth: 1000,
minHeight: 670,
titleBarStyle: 'show',
webPreferences: [Object]
}
}
} |
Suggested solutions options, make saving to local storage for the Possibly add a callback or some kind of trigger to notify on text changes in Relevant issues in transcript editor repo bbc/react-transcript-editor#177 (comment) |
I would like to understand this a bit more before getting into the solution, so I'm going to install the Setting up breakpad server for Crash ReporterJFYI the mini-breakpad-server is a bit quirky.
|
As @pietrop suggested it does look like a localStorage thing.
All the threads in the error stack:
|
https://chromium.googlesource.com/chromium/src/+/master/storage/browser/blob/README.md This is maybe what it's using under the hood - we can see some caveats there, like "creating the blob too fast"! |
Describe the bug
@bbc/react-transcript-editor
+ Electron crashes the app (white screen)This was initially encountered by @greggcorp while correcting text using the app.
To Reproduce
Steps to reproduce the behavior:
1.0.9-alpha.1
At this point, is unclear how to reproduce. It's been reported that
Expected behavior
Expecting the app not to crash to white screen when correcting text.
Screenshots
NA
Additional context
I have a hunch that It might be a problem with local storage in electron version of chrome v8 maxing out on space, and not handling that very well.
Transcript editor saves to local storage every time you stop typing. (also see bbc/react-transcript-editor#177 (comment))
To test this hypothesis
Used this snippet from stack overlow Find the maximum length of a single string that can be stored in localStorage and copy and pasted it in the console of electron. with minor modification to remove the dependency from the html element on the page.
for convenience
Slowly but surely the page went blank, with no error on the console 🤷♂
If I do the same thing with the web version of the transcript editor component using the storybook demo there doesn't seem to be the same problem. see console log in screenshot below.
possibly related electron/electron#2357 (comment) from a search for "electron white screen crash"
electron/electron#2357 (comment)
The text was updated successfully, but these errors were encountered: