Skip to content

config init: unlink files before copying over#2389

Closed
bendlas wants to merge 1 commit intowebtorrent:masterfrom
bendlas:fix-startup-crash
Closed

config init: unlink files before copying over#2389
bendlas wants to merge 1 commit intowebtorrent:masterfrom
bendlas:fix-startup-crash

Conversation

@bendlas
Copy link
Copy Markdown
Contributor

@bendlas bendlas commented Oct 28, 2023

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)

When:

  • running a webtorrent instance in an electron instance with broken mesa libs
  • (does not load) closing blank window
  • run in electron with correct gfx, startup crashes:

Error:

Missing config file: Creating new one
(node:679284) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, copyfile '/home/user/code/webtorrent-desktop/static/bigBuckBunny.jpg' -> '/home/user/.config/WebTorrent/Posters/88594aaacbde40ef3e2510c47374ec0aa396c08e.jpg'
    at copyFileSync (node:fs:2894:3)
    at func (node:electron/js2c/asar_bundle:2:2131)
    at overwriteSync (/home/user/code/webtorrent-desktop/src/renderer/lib/state.js:125:3)
    at /home/user/code/webtorrent-desktop/src/renderer/lib/state.js:158:5
    at Array.forEach (<anonymous>)
    at setupStateSaved (/home/user/code/webtorrent-desktop/src/renderer/lib/state.js:155:27)
    at EventEmitter.load (/home/user/code/webtorrent-desktop/src/renderer/lib/state.js:230:15)

I wish I could explain why this happens, but neither ls nor lsattr shows anything:

% ls -alh ~/.config/WebTorrent/Posters
Missing config file: Creating new one
(node:679284) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, copyfile '/home/user/code/webtorrent-desktop/static/bigBuckBunny.jpg' -> '/home/user/.config/WebTorrent/Posters/88594aaacbde40ef3e2510c47374ec0aa396c08e.jpg'
    at copyFileSync (node:fs:2894:3)
    at func (node:electron/js2c/asar_bundle:2:2131)
    at overwriteSync (/home/user/code/webtorrent-desktop/src/renderer/lib/state.js:125:3)
    at /home/user/code/webtorrent-desktop/src/renderer/lib/state.js:158:5
    at Array.forEach (<anonymous>)
    at setupStateSaved (/home/user/code/webtorrent-desktop/src/renderer/lib/state.js:155:27)
    at EventEmitter.load (/home/user/code/webtorrent-desktop/src/renderer/lib/state.js:230:15)
% lsattr -a ~/.config/WebTorrent/Posters
---------------------- /home/user/.config/WebTorrent/Posters/.
---------------------- /home/user/.config/WebTorrent/Posters/..
---------------------- /home/user/.config/WebTorrent/Posters/02767050e0be2fd4db9a2ad6c12416ac806ed6ed.jpg
---------------------- /home/user/.config/WebTorrent/Posters/6a02592d2bbc069628cd5ed8a54f88ee06ac0ba5.jpg
---------------------- /home/user/.config/WebTorrent/Posters/a88fda5954e89178c372716a6a78b8180ed4dad3.jpg
---------------------- /home/user/.config/WebTorrent/Posters/88594aaacbde40ef3e2510c47374ec0aa396c08e.jpg
---------------------- /home/user/.config/WebTorrent/Posters/6a9759bffd5c0af65319979fb7832189f4f3c35d.jpg

The workaround fixes it though.

Which issue (if any) does this pull request address?

Is there anything you'd like reviewers to focus on?

@github-actions
Copy link
Copy Markdown

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@github-actions github-actions bot added the stale label Dec 27, 2023
@bendlas
Copy link
Copy Markdown
Contributor Author

bendlas commented Dec 28, 2023

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

Still relevant. Only thing blocking this is lack of reviews.

@github-actions
Copy link
Copy Markdown

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@github-actions github-actions bot added the stale label Feb 27, 2024
@github-actions github-actions bot closed this Mar 5, 2024
@bendlas
Copy link
Copy Markdown
Contributor Author

bendlas commented Jun 16, 2024

@gillesdemey @rom1504 I think we should also have this in. It has finally fixed the nagging heisenbug, where webtorrent-desktop randomly stops starting up. As with #2388, we've been shipping this in NixOS for some time now.

If you think it would be worth, please re-open. I'll be happy to rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant