AddonManager never goes further “Checking connection”

Open
#318 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start in NetworkManager.py at the reply.finished connection near line 256 and __reply_finished near lines 547-550. Inspect the other reply-handling sites in that file for the same PySide6 behavior, then exercise the AddonManager connection check. Done means the check proceeds past “Checking connection” and completed replies still trigger their data handling and notifications.

Written by the indexing model from the issue text.

Description

Here reply is always None, rendering the function useless. That's a known peculiarity of PySide6.

https://github.com/FreeCAD/AddonManager/blob/a38c8f003e8131bb7588313374abb4ccb26da9e9/NetworkManager.py#L550

As a workaround against that, I suggest changing
https://github.com/FreeCAD/AddonManager/blob/a38c8f003e8131bb7588313374abb4ccb26da9e9/NetworkManager.py#L256
to

        reply.finished.connect(lambda r=reply: self.__reply_finished(r))

and
https://github.com/FreeCAD/AddonManager/blob/a38c8f003e8131bb7588313374abb4ccb26da9e9/NetworkManager.py#L547-L550
to

     def __reply_finished(self, reply: QtNetwork.QNetworkReply | None = None) -> None:
         """Called when a reply has been completed: this makes sure the data has been read and
         any notifications have been called."""
         if reply is None:
             reply = self.sender()

to maintain the compatibility with calls I might've missed. I find the solution dirty, but it works.

There are many more places like this, even in the file. That's the reason I make the issue, not a PR.


FreeCAD Info:

OS: Manjaro Linux (KDE/plasma/wayland)
Architecture: x86_64
Version: 1.0.2.39319 (Git)
Build type: Release
Branch: makepkg
Hash: 256fc7eff3379911ab5daf88e10182c509aa8052
Python 3.13.7, Qt 6.10.1, Coin 4.0.5, Vtk 9.5.2, OCC 7.9.2
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/
Installed mods:

  • CADExchanger
  • fasteners-backup-before-zip-migration 0.5.33 (Disabled) ← this proves the changes work well!
  • fasteners 0.5.43
  • pcb 6.2023.1
  • manifest.json
Dominant language
Python
Stars
24
Forks
36
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FreeCAD/AddonManager

All issues in FreeCAD/AddonManager

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.