Skip to content

Conversation

lukas-hetzenecker
Copy link
Contributor

After upgrading to Qt 5.15/PySide2 5.15.1 I noticed that the asyncio-Qt mainloop integration was completely broken - websockets stayed hanging in a connecting state, async HTTP requests never returned a response i.e. no callbacks were ever called.

Troubleshooting revealed that the __on_read_activated slots in _unix.py received a PySide2.QtCore.QSocketDescriptor object. Those were obviously not found in the _fd_to_key directory mapping, as the key expected there is the (int) file descriptor.

In the Qt documentation I found that the QSocketNotifier.activated behavior changed with Qt 5.15, whereas previously only the QSocketNotifier::activated(int socket) signal existed, now this signal became overloaded with QSocketNotifier::activated(QSocketDescriptor socket, QSocketNotifier::Type type) as arguments.

Long story short, this pull requests fixes the issue by explicitly connecting the signal with "int" soket fd as argument.

Explicitly use int socket argument, otherwise slot would receive a QSocketDescriptor resulting in silently ignored fd_to_key map misses
@lukas-hetzenecker
Copy link
Contributor Author

Related merge request in asyncqt: gmarull/asyncqt#28

@codecov-io
Copy link

codecov-io commented Oct 25, 2020

Codecov Report

Merging #12 into master will decrease coverage by 0.08%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
- Coverage   64.84%   64.75%   -0.09%     
==========================================
  Files           4        4              
  Lines         657      661       +4     
==========================================
+ Hits          426      428       +2     
- Misses        231      233       +2     
Impacted Files Coverage Δ
qasync/_unix.py 23.13% <0.00%> (ø)
qasync/__init__.py 75.12% <100.00%> (-0.26%) ⬇️
qasync/_windows.py 74.59% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 103b9a6...8844dd1. Read the comment docs.

@TheGreatCabbage TheGreatCabbage self-assigned this Oct 25, 2020
@TheGreatCabbage TheGreatCabbage merged commit f86c8c6 into CabbageDevelopment:master Oct 25, 2020
@TheGreatCabbage
Copy link
Member

TheGreatCabbage commented Oct 25, 2020

Nice work! I'll try and get a new release published to PyPI tomorrow.

@TheGreatCabbage
Copy link
Member

This is now live in version 0.9.5. Thanks for your contribution!

nocarryr added a commit to nocarryr/jvconnected that referenced this pull request Dec 9, 2020
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.

3 participants