Skip to content

job-completed notification is not delivered for a printer subscription when the job is canceled #1209

@m7913d

Description

@m7913d

Describe the bug
The job-completed notification is not delivered to a printer subscription when the job is canceled.
Currently, this event is only delivered for job subscription or whole server subscriptions.

To Reproduce
Steps to reproduce the behavior:

  1. Create a printer subscription for at least the job-completed event
  2. Pause the printer (to be able to cancel the job)
  3. Print a document to the printer
  4. Cancel the job

Expected behavior
A job-completed notification should be send for the printer subscription.

Possible solution
This issue is caused by job->printer only being set when the job actually starts printing. Hence, when cupsdSetJobState is called for the canceled job, a null pointer is passed to cupsdAddEvent for the dest argument.

It may be solved by adding the following lines to the cupsAddEvent function:

if (!dest && job && job->dest)
  dest = cupsdFindDest(job->dest); // lookup the printer if it is not explicitly provided and the job contains a named destination

System Information:
All OSes / cups versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions