🐛 Improved reliability of email analytics events - #29895
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 24s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 2m 2s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 2m 44s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 1m 58s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 34s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | <1s | View ↗ |
nx run-many -t lint -p ghost,ghost-monorepo |
✅ Succeeded | 21s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 9s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-08-11 21:29:34 UTC
ref #29890 (review) Big picture ----------- We sometimes failed to create the job row for the "missing" job. This could cause: - unnecessary extra fetches from Mailgun - events to be dropped entirely, if the site was off for awhile Details ------- There are four jobs for email analytics: 1. opened 2. non-opened 3. scheduled 4. missing Before this change, `setJobTimestamp` failed to upsert the job row. For the first three job types, it turned out that was fine, because they were already created by previous code paths. But not for the "missing" job! Before this change, we'd only create the "missing" job row when: - no missing events were found - there was an error processing the batch Now, we create it at the right time as intended.
d9e5218 to
c5fde44
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## email-analytics-service-wrapper-should-always-have-a-service #29895 +/- ##
=============================================================================================
Coverage 75.43% 75.43%
=============================================================================================
Files 1607 1607
Lines 140874 140875 +1
Branches 17454 17455 +1
=============================================================================================
+ Hits 106266 106268 +2
- Misses 33531 33562 +31
+ Partials 1077 1045 -32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

ref #29890 (review)
Big picture
We sometimes failed to create the job row for the "missing" job. This could cause:
Details
There are four jobs for email analytics:
Before this change,
setJobTimestampfailed to upsert the job row. For the first three job types, it turned out that was fine, because they were already created by previous code paths. But not for the "missing" job!Before this change, we'd only create the "missing" job row when:
Now, we create it at the right time as intended.