Skip to content

Conversation

@ju1ius
Copy link
Contributor

@ju1ius ju1ius commented Aug 22, 2025

Description

When calling DetailsDependenciesView.update(), additions of new DependencyEntryRow instances were scheduled by calling GLib.idle_add(new_dependency, dep, plain=True).

However, GLib.idle_add doesn't support keyword arguments other than "priority" (which is an alias for GLib.idle_add(priority, func, *args)). This ended up raising the following exception:

Error while running async job: <function DependenciesView.update.<locals>.process_dependencies at 0x734818d37880>
 Exception: idle_add() got an unexpected keyword argument 'plain'

File "/app/share/bottles/bottles/backend/utils/threading.py", line 62, in __target
 result = self.task_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/share/bottles/bottles/frontend/views/details_dependencies_view.py", line 140, in process_dependencies
 GLib.idle_add(new_dependency, dep, plain=True)

Moreover, when a DependencyEntryRow, is created with plain=True then the dependency argument must be a str, not a tuple, which was not the case here.

Fixes #3983, #3992, #3997, #4006, #4018, #4019, #4037, #4041, #4044.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

By building an runnig the flatpak locally, creating a new bottle, adding and removing some dependencies, while verifying that no relevant exceptions were logged on stdout/err.

@mirkobrombin
Copy link
Member

Hi, can u re-make this PR on top of main, please? Sorry for the trouble.

When calling `DetailsDependenciesView.update()`, addition of new
dependency rows were scheduled by calling `GLib.idle_add(new_dependency,
dep, plain=True)`, which (AFAIU) was wrong for the following reasons:

* `GLib.idle_add()` doesn't support keyword arguments other than
"priority" (as an alias for `GLib.idle_add(priority, func, *args)`).
This ended up raising "unknown keyword argument" exceptions.

* When a `DependencyEntryRow`, is created with `plain=True` then the
dependency argument must be a string, not a tuple.
@ju1ius ju1ius force-pushed the ju1ius/fix-idle-add branch from 115903e to f4105bb Compare October 14, 2025 18:13
@mirkobrombin mirkobrombin merged commit da2d4ab into bottlesdevs:main Oct 24, 2025
@reiyua
Copy link

reiyua commented Oct 28, 2025

Cheers @ju1ius for providing the fix to my issue!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: idle_add() got an unexpected keyword argument 'plain'

3 participants