Describe the bug
Email instance views can occasionally show inconsistent open counts on a single page load, due to {{instance.initial_opens}} being re-evaluated each time it's called.
|
<strong class="lead font-weight-black">{{instance.initial_opens}}</strong> |
|
</div> |
|
<div class="col-4 d-flex flex-column justify-content-between"> |
|
<h4 class="font-weight-bold small text-uppercase">Open Rate</h4> |
|
<strong class="lead font-weight-black text-info-aw">{{instance.open_rate}}%</strong> |
|
</div> |
|
</div> |
|
<p class="small pt-3 mb-3">Of the <strong>{{instance.recipient_details.count}}</strong> recipients, <strong >{{instance.initial_opens}}</strong> opened the email. An open rate of <strong>{{instance.open_rate}}%</strong>.</p> |
{{instance.click_recipient_count}} likely has the same issue.
Steps to Reproduce
- Open an instance view of an email that's recently sent to a lot of people
- Refresh until something like this happens

Expected Behavior
Stats like this should be consistent wherever they're printed on the page.
Possible Fix
Look into caching/storing property values like this to prevent them from being looked up multiple times on load. lru caching, custom template variables, {% with %} usage could be worth looking into
Your environment:
n/a
Additional context
n/a
Describe the bug
Email instance views can occasionally show inconsistent open counts on a single page load, due to
{{instance.initial_opens}}being re-evaluated each time it's called.PostMaster/templates/manager/email-instance.html
Lines 56 to 63 in 2b97e8a
{{instance.click_recipient_count}}likely has the same issue.Steps to Reproduce
Expected Behavior
Stats like this should be consistent wherever they're printed on the page.
Possible Fix
Look into caching/storing property values like this to prevent them from being looked up multiple times on load. lru caching, custom template variables,
{% with %}usage could be worth looking intoYour environment:
n/a
Additional context
n/a