Email: restore all-subscribers segment filter (fix Kit 422 at send) - #1978
Open
benbalter wants to merge 3 commits into
Open
Email: restore all-subscribers segment filter (fix Kit 422 at send)#1978benbalter wants to merge 3 commits into
benbalter wants to merge 3 commits into
Conversation
The real cause of the gif-or-jif broadcast 422 (not the media tags): the payload omits subscriber_filter. Kit v4 422s at send when it's omitted. The prior working code resolved a real "All subscribers" segment and referenced it, because Kit rejects BOTH an omitted filter and an explicit all_subscribers type. The public:false workaround (26789eb) tore that segment logic out on an untested bet that omitting the filter is valid at public:false. The gif-or-jif post is the first new post since, so it was the first real send under that workaround, and it failed exactly as the deleted comment warned. Known-failing combinations: - public:true + segment filter -> 422 (the July all-subscribers regression) - public:false + no filter -> 422 (omitted-filter, current) This restores segment targeting AND keeps public:false: the union of both constraints (public:false to dodge the public-to-all 422, a real segment reference to dodge the omitted-filter 422). Segment id is resolved up front so a misconfiguration fails before rendering or sending anything. Note: this combination has not yet been validated against the live API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benbalter
enabled auto-merge (squash)
September 9, 2026 03:24
Per Kit v4 docs, a broadcast only *sends* when public:true with a send_at; a public:false broadcast is just stored as a draft and never goes out. That was the actual bug behind the whole run of 422s: every attempt was either public:false (draft-only) or used a send_at of "now", which Kit rejects as a past-dated schedule. Changing content, public flag, and subscriber_filter never moved it because none of them was the cause. Switch to public:true (the broadcast will appear in the Kit newsletter feed, accepted tradeoff), keep the resolved all-subscribers segment filter, and set send_at ~2 minutes in the future so the schedule is unambiguously valid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benbalter
disabled auto-merge
September 10, 2026 17:35
Owner
Author
|
On hold — do not merge yet. Investigation confirmed this PR does not fix the broadcast failure. The 422 is the open, server-side Kit bug tracked in the support ticket: all-subscribers audience × full-size content 422s, invariant to
The only paths that currently deliver a full-size post: send to a tag covering all subscribers, or send via the Kit web UI. Auto-merge disabled. Revisit once Kit resolves the API bug (or repurpose this to tag-based sending). |
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.
Real cause of the gif-or-jif broadcast 422
Follow-up to #1977. The media plugin was a legit inbox cleanup but not the cause. The actual cause, grounded in this script's own git history:
The payload omits
subscriber_filter, and Kit v4 422s at send when it's omitted. The prior working code (32b47906) resolved a real "All subscribers" segment and referenced it, because Kit rejects both an omitted filter (422 at send) and an explicitall_subscriberstype (422 at create). Thepublic:falseworkaround (26789ebe) tore that segment logic out on an untested bet. The gif-or-jif post was the first real send since that workaround (every prior recent run was a "No new posts" no-op), so it was never caught.Known-failing combinations
public:true+ segment filter → 422 (the July all-subscribers regression)public:false+ no filter → 422 (omitted-filter, currentmain)This PR
Restores segment targeting and keeps
public:false— the union of both constraints, which was never actually run together. Segment id is resolved up front so a misconfiguration fails before rendering or sending.Verification
node --checkpasses; DRY_RUN renders the post fine (media degraded via Email: degrade web-only media to email-safe HTML for Kit broadcasts #1977, 10.9 KB)public:false + segmentcombination is not yet validated against the live API — validated by the real re-send dispatch after merge.🤖 Generated with Claude Code