fix(workflows): keep push test sends out of metrics and assets - #75800
Draft
dmarchuk wants to merge 2 commits into
Draft
fix(workflows): keep push test sends out of metrics and assets#75800dmarchuk wants to merge 2 commits into
dmarchuk wants to merge 2 commits into
Conversation
2 tasks
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
dmarchuk
force-pushed
the
dmarchuk/push-test-sends-skip-metrics
branch
from
July 31, 2026 08:17
96d5bd2 to
ffffc62
Compare
dmarchuk
force-pushed
the
dmarchuk/push-test-sends-skip-metrics
branch
from
July 31, 2026 09:45
7835edf to
3f667e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A push step's "Run test" in the editor is indistinguishable from a real send. It records
push_sent/push_skipped/push_failed, and since #74555 it also captures a row on the Assets tab. So testing a step inflates the workflow's Metrics tab and puts a preview in the list of what real recipients were sent.The email path already avoids exactly this.
executeSendEmailtakes anisTestflag and skips the business metric, the skip-reason metric, the asset capture and the engagement event when it is set. Push never received the flag: the executor callsexecuteSendPushNotification(nextInvocation)with nothing, and the signature has nowhere to put it.The metrics half predates #74555. The Assets row is new with it, which is what makes the inconsistency worth closing now.
Changes
Threads the same signal email uses.
sendEmailsInlineis only ever set by the test panel, so it doubles as "this is a test send", and the executor now passes it to the push branch too.pushMetricreturns early whenisTest, so none of the three business metrics land.The send itself still happens, and the run log still reports acceptance per channel, so a test send behaves as before from the tester's point of view.
How did you test this code?
push-notification.service.test.ts- 34 tests, one new:The other 33 confirm the added parameter did not disturb the existing send, fan-out, skip, prune, reschedule or capture behavior.
tsc --noEmitadds no new errors (7 pre-existing@posthog/replay-anonymizermodule-resolution errors are present on the base branch too, from an unbuilt local package).Automatic notifications
Docs update
None needed. Test sends are not a documented surface.
🤖 Agent context
Autonomy: Human-driven (agent-assisted). Directed by @dmarchuk, assigned as DRI.
Stacked on #74555, which introduces the asset capture this guards.
Found by asking whether push does the same thing as email for test sends. It doesn't, and the gap was invisible from the push side alone: there is no
isTestin that file to notice the absence of. The email service guards four separate places on it, which is the shape to copy if push later gains engagement events of its own.