Repository navigation
Fix AuthorName.setMiddleName to tolerate null middle names - #11
Merged
Merged
Conversation
Middle name is optional (unlike first/last): many identities have no middle name, so the stored DynamoDB attribute is null. The setter threw IllegalArgumentException on null, which broke Identity deserialization via the DynamoDBMapper — findByUid raised DynamoDBMappingException ("could not unconvert attribute"), surfacing as a 500 in ExternalArticleController.addExternalArticle for any such person (~76% of a sampled cohort). Accept null (middleName=null, middleInitial=""); first/last keep their required-field guards.
7 of 14 tasks
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
AuthorName.setMiddleNamethrowsIllegalArgumentExceptiononnull. The AWS SDK v1DynamoDBMappercalls this setter during unconvert, so anyIdentitywhose storedAuthorNamehas a null middle name fails to deserialize:This surfaces as an HTTP 500 from
POST /reciter/external-article/by/uid(andGET /reciter/find/identity/by/uid) for every person with a null middle name. In a sampled cohort of 162 people, 123 (76%) hit it — so the external-article manual-add feature is broadly unusable, not an edge case.Fix
Middle name is optional, unlike first/last name (required identity fields), so a deserialization setter must tolerate null.
setMiddleName(null)now setsmiddleName=null,middleInitial=""and returns; non-null behavior is unchanged.setFirstName/setLastNamekeep their required-field guards.Follow-up (not in this PR)
reciter-identity-modelartifact (2.0.11 if unreleased, else 2.0.12).ReCiter/pom.xmlfrom2.0.10to the released version and redeploy.mvn compileverified clean.