Skip to content

Quantity mismatch: adding items to envelope #5949

@elramen

Description

@elramen

When adding managed items to a managed envelope, there are several mismatches that can occur.

Example - adding an event-creating attachment:

  1. Envelope will have Error:1 more than the item.
  2. Idea: Simply offset records by Error:1. But this leads to the following mismatches:
    1. Error:1 too much when there is also an event item added.
    2. Error:1 too much when there is also another event category, e.g. transaction, added before the attachment
    3. Transaction:1 too little when there is also another event category, e.g. transaction, added after the attachment

Root causes:

  1. EnvelopeSummary only has 1 event_category, and its quantities implementation adds 1 extra count for the event_category - there is a race condition when multiple items added are event_category-creating.
  2. An error-creating attachment has a zero error quantity as a standalone item.
  3. EnvelopeSummary does not count the total number of error items - an envelope will at most have Error:1.

Draft PR: #5919

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions