Skip to content

Conversation

Michal-Koeckeis-Fresel
Copy link
Contributor

#2460

fix TypeError in Bug #2460

@TheophileDiot TheophileDiot requested a review from Copilot July 8, 2025 10:17
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR resolves a TypeError in the plugin synchronization flow by tightening the check_plugin_changes logic to only generate plugins when the database update succeeds and by refining the dict_to_frozenset utility’s type annotations and recursion.

  • Only call generate_external_plugins on a successful database update, and return early (sending files) if there are no changes.
  • Enhance dict_to_frozenset with a Hashable return type and recursive handling of nested lists/dicts.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/scheduler/main.py Conditional plugin generation and early return on no changes
src/common/utils/common_utils.py Import Hashable & improve dict_to_frozenset signature
Comments suppressed due to low confidence (3)

src/common/utils/common_utils.py:40

  • [nitpick] Add unit tests for dict_to_frozenset covering nested dicts and lists to verify consistent ordering and hashability in all edge cases.
def dict_to_frozenset(d: JsonValue) -> Hashable:

src/scheduler/main.py:794

  • The variable external_plugins is not defined in this scope; it should likely be tmp_external_plugins to match the change detection above.
                        err = SCHEDULER.db.update_external_plugins(external_plugins, _type=_type, delete_missing=True)

src/common/utils/common_utils.py:40

  • JsonValue is not imported or defined in this module; add an import or replace it with a supported type alias (e.g., Any or a custom JsonValue alias) to avoid a NameError during type checks.
def dict_to_frozenset(d: JsonValue) -> Hashable:

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.

1 participant