Skip to content

Fix grouping of multi-protocol printers - #483

Merged
alexpevzner merged 2 commits into
masterfrom
fix/group-printer-protocols
Oct 20, 2026
Merged

alexpevzner merged 2 commits into
masterfrom
fix/group-printer-protocols

Conversation

@SinghCod3r

Copy link
Copy Markdown
Collaborator

Description

Fixes an issue where the same physical printer is displayed multiple times in the Select Device view when it is discovered through different protocols, such as IPPS and LPD.

For example, a printer advertising:

  • ipps://<printer>._ipps._tcp.local/
  • lpd://<printer>._printer._tcp.local/

was previously treated as two different physical devices because the protocol-specific DNS-SD suffixes resulted in different network host values.

This change recognizes DNS-SD service-instance hostnames embedded in direct CUPS URIs and uses the service instance as the DNS-SD hostname, allowing the existing PhysicalDevice equality logic to correctly group the connections.

Expected behavior

Before:

  • Same physical printer appears multiple times in the device list.
  • Each protocol is shown as a separate printer.

After:

  • The physical printer appears only once.
  • All available protocol connections are grouped under that printer.
  • The user can select/switch between available connections from the Connections view.

Testing

Added regression tests covering:

  • IPPS + LPD grouping for the same printer
  • IPPS + IPP + LPD grouping
  • Different printers with the same model
  • Same DNS-SD instance with different serial numbers
  • Normal hostnames
  • IPv4/network printers
  • Socket printers
  • USB printers
  • Existing dnssd:// devices
  • DNS-SD instance names containing dots
  • UI grouping and connection selection

Core test suite:

160 passed, 0 failed

The existing test_ppds.py failure is unrelated and also occurs on the clean master branch.

Related issue

Fixes the duplicate physical printer entries caused by multi-protocol DNS-SD discovery.

@alexpevzner
alexpevzner merged commit 87ca901 into master Oct 20, 2026
5 checks passed
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.

2 participants