When adding managed items to a managed envelope, there are several mismatches that can occur.
Example - adding an event-creating attachment:
- Envelope will have Error:1 more than the item.
- Idea: Simply offset records by Error:1. But this leads to the following mismatches:
- Error:1 too much when there is also an event item added.
- Error:1 too much when there is also another event category, e.g. transaction, added before the attachment
- Transaction:1 too little when there is also another event category, e.g. transaction, added after the attachment
Root causes:
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.
- An error-creating attachment has a zero error quantity as a standalone item.
EnvelopeSummary does not count the total number of error items - an envelope will at most have Error:1.
Draft PR: #5919
When adding managed items to a managed envelope, there are several mismatches that can occur.
Example - adding an event-creating attachment:
Root causes:
EnvelopeSummaryonly has 1 event_category, and itsquantitiesimplementation adds 1 extra count for the event_category - there is a race condition when multiple items added are event_category-creating.EnvelopeSummarydoes not count the total number of error items - an envelope will at most have Error:1.Draft PR: #5919