Skip to content

Update Member: Remove email change support - #99

Open
Allimonae wants to merge 1 commit into
mainfrom
disable-email
Open

Update Member: Remove email change support#99
Allimonae wants to merge 1 commit into
mainfrom
disable-email

Conversation

@Allimonae

@Allimonae Allimonae commented Aug 26, 2026

Copy link
Copy Markdown
Member

Disables email changes in member profile updates until email change verification is implemented. Removed and updated some tests.

What changed?

The email field in the member profile form is now always disabled, with an updated description informing users that email changes are not currently supported. On the backend, updateMember now throws a ValidationException if an email change is attempted. The previously existing duplicate email handling logic (including the DuplicateKeyException catch block and MemberDuplicateException) has been removed from the update flow since it is no longer reachable.

Why make this change?

Email changes require a verification flow (e.g., confirming ownership of the new address) that has not yet been implemented. Disabling this functionality prevents unverified email changes until proper verification support is in place.

Allimonae commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@Allimonae
Allimonae marked this pull request as ready for review August 26, 2026 23:50
@Allimonae
Allimonae changed the base branch from add-profile-link to graphite-base/99 August 26, 2026 23:51
@graphite-app
graphite-app Bot changed the base branch from graphite-base/99 to main August 26, 2026 23:52
@graphite-app
graphite-app Bot requested a review from a team August 26, 2026 23:52
@graphite-app

graphite-app Bot commented Aug 26, 2026

Copy link
Copy Markdown

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (08/26/26)

2 reviewers were added to this PR based on Henry Chen's automation.

Member updatedMember = memberRepo.updateMember(member).orElseThrow(() -> new MemberNotFoundException(id));
return MemberDto.from(updatedMember);
} catch (DuplicateKeyException e) {
throw new MemberDuplicateException(member.getEmail());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this block? i get that we don't need it for now and we can enable later, but it leaves us prone to forgetting to add it back.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only argument i could see for removing this is that we're not unnecessarily querying the DB here, but even then it should be commented out with a note to re enable when email verification is added later.

.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isConflict())
.andExpect(jsonPath("$.success").value(false));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not leave this in and comment it out for when we do enable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning on making a separate verification flow for email changes, so even if I were to keep the test case it would still be temporary

@spiffyy99 spiffyy99 Aug 28, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is more about not losing the work you did to write that test logic. Even if it gets moved to a different service, you can repurpose it for later.

void updateMember_successWhenUpdatingOtherFieldsWithUnchangedEmail() {
final UUID id = UUID.randomUUID();
final UpdateMemberRequest request = new UpdateMemberRequest(
Optional.empty(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above - we should comment out this test instead of removing it if we're going to add back the logic later

@spiffyy99

Copy link
Copy Markdown

also add a test in for the validation exception being thrown

Optional.of("UpdatedFirstName"),
Optional.of("UpdatedLastName"),
Optional.of("updated@example.com"),
Optional.empty(), // Email changes are not currently supported

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no representative of how the data actually comes in from the frontend, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email changes are always disabled from the frontend so it will always be empty

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

}

@Test
void updateMember_badRequestWhenBlankRequiredField() throws Exception {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed since this test is redundant with updateMember_badRequestWhenValidationFails

}

// @Test
// void updateMember_throwsExceptionWhenEmailIsDuplicate() {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just commented out the code, no idea why its not lining up correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants