Skip to content
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

[Linux - Arch] Leftover files if discord is uninstalled before unplugging #518

Open
3 tasks done
SomeAspy opened this issue Jul 19, 2023 · 2 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@SomeAspy
Copy link
Contributor

Describe the bug

Not looking for a fix at the moment, this issue is more to just have this issue on record.

if discord is removed via the package manager before unplugging, 2 files will be left behind.
/opt/discord-[development/canary/ptb]/
|- app.asar
|- app.orig.asar

A quick patch would be to add some sort of pnpm run cleanup to remove leftover files, as this can prevent discord from reinstalling cleanly, ex:

errors occurred, no packages were upgraded.
error: failed to commit transaction (conflicting files)
discord-development: /opt/discord-development/resources/app.asar exists in filesystem
Errors occurred, no packages were upgraded.
 -> error installing: [discord-*version*.tar.zst] - exit status 1

Reproduction steps

  1. Remove discord (do not unplug prior)
  2. Remnants at `/opt/discord-[edition]

Expected behavior

There should be no remnants, or at the minimum, no conflicting files

Actual behavior

conflicting files are left behind

Additional information

No response

Please confirm the following

  • I checked if Discord and Replugged are up to date
  • I made sure this is not related to an external plugin or a theme
  • I searched the issues to make sure this bug has not been reported before.
@SomeAspy SomeAspy added the bug Something isn't working label Jul 19, 2023
@EastArctica
Copy link
Contributor

Because this is linux, it may be installed to /opt/share/discord-[development-canary-ptb].

On Manjaro it was there when installed from the aur at least 🤷

@j4k0xb
Copy link
Contributor

j4k0xb commented Feb 25, 2024

I would rather avoid leftover files in the first place by only editing the app.asar file and not creating app.orig.asar

{
  "name": "discord",
  "description": "Discord Client for Desktop - Bootstrapper",
- "main": "app_bootstrap/index.js",
+ "main": "loader.js" 

which loads both replugged and the original main:

require("path/to/replugged/entrypoint");
require("./app_bootstrap/index.js");

This would also fix the upgrading issue:

# pacman -S discord
resolving dependencies...
looking for conflicting packages...

Packages (1) discord-0.0.43-1

Total Installed Size: 221,35 MiB
Net Upgrade Size: 0,00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [################################################] 100%
(1/1) checking package integrity [################################################] 100%
(1/1) loading package files [################################################] 100%
(1/1) checking for file conflicts [################################################] 100%
(1/1) checking available disk space [################################################] 100%
:: Processing package changes...
(1/1) reinstalling discord [################################################] 100%
error: extract: not overwriting dir with file /opt/discord/resources/app.asar
error: problem occurred while upgrading discord
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants