Gig create/update rejects venue-linked gigs (Invalid create gig data) - #257
Merged
Merged
Conversation
newGig/updateGig hard-required legacy city/usState/venue fields, so every gig created via JaM's venue-picker (which sends venueId + empty legacy fields) was rejected. Relax both guards to require datetime AND (venueId OR non-empty venue), and drop the schema's venue required:true so Mongoose doesn't reject venue-linked docs either. Bump patch version 3.0.11 -> 3.0.12.
JoshuaVSherman
marked this pull request as ready for review
July 29, 2026 00:25
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
newGig's create guard (src/AgController/index.ts) to requiredatetimeAND (venueIdOR non-emptyvenue), dropping the hardcity/usState/venuerequirement that rejected every venue-linked gig from JaM's venue-picker.updateGigin the same file, keeping the Failed gig update reports nothing: updateGig swallows its error, so neither socketError nor gigUpdated is emitted #253 rethrow behavior untouched.src/model/gig/gig-schema.ts'svenuefield torequired: falseso Mongoose doesn't reject venue-linked docs that have no free-text venue.test/AgController/index.spec.tscovering: venue-linked payload succeeds, one-off free-text-venue payload succeeds, neither venueId nor venue still rejected, missing datetime still rejected.Closes #256
How to test locally
Run:
npm testExpect: eslint 0 errors, typecheck clean, all vitest suites green.
Exercise the change itself with a local socketcluster-server client (or via JaM's UI once JaMmusic#1254 is unblocked): connect, authenticate, then emit
newGigwith a venue-linked payload:Expect: server publishes
gigCreated(nosocketError). Repeat witheditGig/gigIdand confirmgigUpdatedis published. Then emit a payload with neithervenueIdnorvenueand confirmsocketErrorwithInvalid create gig data(orInvalid gig datafor edit) is transmitted.Test evidence
🤖 Work by Claude Code — Sonnet 5