HangfireIO / HangfireIO/Hangfire
Enqueued State entries not storing Queue in the arguments
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
Hi team,
I've recently upgraded a project from 1.7.34 to 1.8.2, mainly because of the `First-class Queue Support` new feature.
Before the upgrade, we were using the `Queue` attribute like this:
``` c#
[Queue("mediumpriority")]
[AutomaticRetry(Attempts = 5)]
void Execute(.....);
```
and it was working like a charm. The job was being executed in the expected queue, and the queue was showing in the Enqueued state as expected

But after upgrading and refactor the code to work with the first-class queue support, the job gets executed in the mediumpriority queue, but the Enqueued state does not longer shows the queue.

...

Also, looking at the Hangfire.State table, I see the queue is still there, but it shows `default` instead of the expected queue.

Taking a quick look at Hangfire code, I see that the EnqueuedState.Queue property gets filled with `default` when no queue is provided, and that it is only filled when the Queue attribute is present ([link to the code](https://github.com/HangfireIO/Hangfire/blob/99023c9c5c37cfb3cb44e4192c5c3f3af323eca5/src/Hangfire.Core/QueueAttribute.cs#L68))
Could you help me understand if I missed some step during the upgrade to 1.8.2 or is this a bug?
Many thanks,
Yeray
Contributor guide
Research direction
Start with src/Hangfire.Core/QueueAttribute.cs at the linked code and trace how the queue value reaches EnqueuedState and the Hangfire.State table. Compare the first-class queue path with the older Queue attribute path and verify the displayed queue and stored queue for both cases. Done means the expected queue is preserved in the enqueued state after upgrading to 1.8.2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100