Skip to content

ProcessItemsAsync exits early when a queued item is missing #372

@Razchek

Description

@Razchek

In ItemAddedManager.ProcessItemsAsync (L60), a missing item results in the foreach loop exiting prematurely:

foreach (var (key, container) in currentItems)
{
var item = _libraryManager.GetItemById(key);
if (item is null)
{
// Remove item from queue.
_itemProcessQueue.TryRemove(key, out _);
return;
}

Because this is inside a foreach, return exits the entire method, preventing remaining queued items from being processed during the same run.
This likely should be continue; so only the missing item is skipped.

If the early exit is intentional, clarification in a comment would help.

(Edit: The reason I found this was because sometimes I would have to run the webhook notifier multiple times to deliver all new updates, even when the metadata was populated)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions