feat(jsx-email): spam score and analysis for the preview#447
Conversation
# Conflicts: # packages/canispam/package.json
c4e1af5 to
d213390
Compare
There was a problem hiding this comment.
Blocking feedback
- Header folding can emit a blank line before long unbroken values, which terminates the header block early and produces malformed EML — packages/jsx-email/src/eml/headers.ts#L24-L31
If you want me to apply a fix, reply with the item number (for example: please fix 1).
|
|
||
| for (const word of words) { | ||
| if (current.length + word.length + 1 > lineLength) { | ||
| lines.push(current.trimEnd()); |
There was a problem hiding this comment.
foldHeader currently pushes current.trimEnd() even when current is only the initial single space. For long unbroken values (for example subject: 'a'.repeat(100) or long UTF-8 encoded subjects), this produces Subject:\r\n\r\n <value>, inserting a blank line that ends the header section early.
Suggested fix: avoid pushing empty continuation lines (for example by initializing current with the header prefix or guarding the lines.push(...) call), so folded output is Subject:\r\n <value> without an intermediate blank line.
|
@CharlieHelps please do a thorough review of this PR to determine if it's ready to merge. Look at the diff, reviews, comments, and referenced issues/docs/links to build a complete understanding. Then respond with a comment that includes a list of MUST fix items that must be fixed before the the PR is merged, and a list of IMPROVEMENTS that shouldn't block the merge but may be quick improvements or things that could be addressed in a follow up PR. The MUST fix items should explain exactly what's wrong and what needs to change to resolve the problem. Both should be numbered lists and the IMPROVEMENTS list should continue counting up from the MUST list. It's OK if there are no IMPROVEMENTS or MUST fix items, you can just omit the lists. |
|
Completed a thorough review of the latest PR state (diff, existing reviews/comments, CI, and referenced stacked-PR context). MUST fix before merge
IMPROVEMENTS (non-blocking)
Current status: not ready to merge until item 1 is fixed. |
d213390 to
c091fa4
Compare
|
@CharlieHelps fix 1 |
c091fa4 to
f08743a
Compare
|
@shellscape Done — I fixed item 1 and pushed it.
Verification run:
|
|
@CharlieHelps youve broken the smoke tests |
|
You’re right — there was a smoke failure on this SHA. I pulled the failing run and reproduced the same CI commands locally on From the failing CI log, the server crashed while loading a truncated generated file ( Most likely this is a flaky watcher rebuild/write race (overlapping async rebuilds exposing a partially written output file). Failing run: https://github.com/shellscape/jsx-email/actions/runs/25898020195/job/76115128058 If you want, I can put up a targeted patch to serialize watcher rebuild/write and stabilize this test path. |
|
@CharlieHelps smoke tests were consistently passing before your change |
|
I re-checked the smoke history around my commit (
So the immediate prior commit passed, but earlier commits in this PR failed smoke too. |
3ecc0d7 to
f08743a
Compare
Component / Package Name:
app-preview, jsx-email
This PR contains:
Are tests included?
Breaking Changes?
If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is
breaking.
List any relevant issue numbers:
N/A
Description
This PR is stacked on feat/jsx-email/spam-scanner and only includes commits unique to feat/jsx-email/spam-check.
It adds spam analysis to the preview app. Templates are scanned in the background, each preview card gets a spam status
button, and clicking it opens a popover with the spam verdict, signal count, grouped findings, rule descriptions, and
expandable evidence.
It also adds jsx-email/eml helpers so preview HTML/plain output can be converted into scannable EML for canispam.
Included changes: