should not skip should use a default template and send, please fix !!!! - #1011
Merged
Conversation
JaMmusic#1250 — a 29-pitch batch silently skipped 6 venues with no venueType/templateOverride/templateType because resolvePitch hard-400'd instead of sending, and the skip report showed only Mongo ObjectIds so Josh couldn't tell which venues failed. - resolvePitch now falls back to DEFAULT_TEMPLATE_TYPE (MidRangeCafeBar, per Josh's decision on the issue) instead of erroring when templateType/templateOverride/venueType all resolve empty. The "no active template" guard still fails hard if even the default is missing/inactive. - Every sendBatch skipped entry now carries venueName (never omitted; '(unknown venue)' when no venue doc could be loaded at all). Bumps patch version 2.10.1 -> 2.10.2. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
JaMmusic#1250 — extends outreach-controller.spec.ts with: - a venue with no templateType/templateOverride/venueType now resolves to DEFAULT_TEMPLATE_TYPE and sends instead of being skipped - an explicit templateType, and venue.venueType, both still win over the default fallback (precedence guardrails) - every sendBatch skipped entry carries venueName, including the UNKNOWN_VENUE_NAME placeholder when no venue doc could be loaded Full `npm test` (eslint + jscpd + typecheck + vitest --coverage) green: 933/933 tests passing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
resolvePitchinsrc/model/outreach/outreach-controller.tsbuilt the template type asbody.templateType || venue.templateOverride || venue.venueType, then hard-400'd when all three were empty — that's how 6 of 29 venues silently got skipped in a batch. It now falls back toDEFAULT_TEMPLATE_TYPE(MidRangeCafeBar, per Josh's decision on the issue — the safest pitch for a venue we know nothing about) instead of erroring. Existing precedence is unchanged; theno active template for type ${type}guard is left intact so a missing/inactive default template still fails hard rather than sending garbage.sendBatch'sskippedentries only carried{ venueId, reason }, so the report was unreadable without cross-referencing Mongo ObjectIds by hand. Every skipped entry now also carriesvenueName— the actual venue name when a venue doc loaded, or theUNKNOWN_VENUE_NAMEplaceholder ('(unknown venue)') when no venue could be loaded at all (invalid id, venue not found). The field is never omitted.DEFAULT_TEMPLATE_TYPEandUNKNOWN_VENUE_NAMEare single exported module-scope constants (no scattered string literals).Closes WebJamApps/JaMmusic#1250
How to test locally
Run the full gate:
npm testExpect: eslint clean, jscpd clean, typecheck clean, all vitest suites green, coverage at/above the 90/90/80/80 gate.
Then exercise the two changes directly against a running server (
npm run dev), using curl againstPOST /outreach/batch(already covered by the unit-test mocks too — see evidence below):Test evidence
Targeted outreach-controller suite:
Full gate (
npm test= eslint + jscpd + typecheck + vitest --coverage), exit 0:🤖 Work by Claude Code — Sonnet 5