prateekmedia / appimagepool

A simple, modern AppImageHub Client, powered by flutter.

Home Page:https://www.pling.com/p/1547076/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integration unsuccessful when desktop file is symlinked

tdiam opened this issue · comments

The AppimageToolsRepository.integrate method expects the desktop file to be a regular file when moving it into $HOME/.local/share/applications/.

However, some images (e.g. KeePassXC) use a symlinked desktop file that points to usr/share/applications/ (allowed in the spec).

This causes the following when the user clicks on "Integrate":

  • A symlink is copied to $HOME/.local/share/applications which however is dangling since it points to a usr/share/applications path that does not exist in that directory.
  • The app is therefore never actually integrated.
  • If the user clicks on "Disintegrate", the action fails with an error of:
    [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (length): Invalid value: Only valid value is 0: 1
    #0      AppimageToolsRepository.remove (package:appimagepool/src/features/home/data/appimage_tools_repository.dart:163)
    <asynchronous suspension>
    #1      AppimageToolsRepository.integrateOrRemove (package:appimagepool/src/features/home/data/appimage_tools_repository.dart:195)
    <asynchronous suspension>
    #2      InstalledViewController.integrateOrRemove (package:appimagepool/src/features/home/presentation/installed/installed_view_controller.dart:26)
    <asynchronous suspension>
    #3      InstalledViewState.integrateOrRemove (package:appimagepool/src/features/home/presentation/installed/installed_view_state.dart:40)
    <asynchronous suspension>
    
    that is caused by this line that expects the desktop file to have proper contents.