Skip to content

TAN-7638 Remove email confirmation FF#13804

Open
luucvanderzee wants to merge 44 commits into
masterfrom
TAN-7638-remove-email-confirmation-FF
Open

TAN-7638 Remove email confirmation FF#13804
luucvanderzee wants to merge 44 commits into
masterfrom
TAN-7638-remove-email-confirmation-FF

Conversation

@luucvanderzee
Copy link
Copy Markdown
Contributor

@luucvanderzee luucvanderzee commented May 7, 2026

Changelog

Changed

  • Removed user_confirmation (email confirmation) feature flag. Email confirmation is now always enabled. This should only affect Viña del Mar

Technical

  • Cleaned up user factory for specs (the defaults were really weird and confusing, and making some tests pass when they should not)

@notion-workspace
Copy link
Copy Markdown

@cl-dev-bot
Copy link
Copy Markdown
Collaborator

cl-dev-bot commented May 7, 2026

Messages
📖 Changelog provided 🎉
📖 Notion issue: TAN-7638
📖

Run the e2e tests

📖 Check translation progress

Generated by 🚫 dangerJS against 8eea134

@luucvanderzee luucvanderzee marked this pull request as ready for review May 11, 2026 14:00
@luucvanderzee luucvanderzee requested a review from jamesspeake May 11, 2026 14:11
Copy link
Copy Markdown
Contributor

@jamesspeake jamesspeake left a comment

Choose a reason for hiding this comment

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

Nice, so many improvements. Sorry took me a while to get through. A few small comments, nothing blocking though. Obviously the main blocker is the one customer still using it!

Have you run the e2e tests on this branch btw? Assume they are fine.

Comment thread back/config/routes.rb
Comment on lines 147 to -150
post 'request_code_unauthenticated', to: 'request_codes#request_code_unauthenticated'
post 'request_code_authenticated', to: 'request_codes#request_code_authenticated'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: could this endpoint be request_code_auth_flow or something similar now?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have absolutely no idea what this file is for!


def create?
active? &&
(record.user_id == user.id) &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this being removed? Seems unrelated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This means that users can now create responses for other users, but this is not possible for polls is it? Surveys yes, but not polls, so not sure why this change is needed.

Copy link
Copy Markdown
Contributor Author

@luucvanderzee luucvanderzee May 15, 2026

Choose a reason for hiding this comment

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

I removed this because a test related to email confirmation suddenly started failing, and I was looking at this code to debug the test. And the whole thing just made no sense. If you are the creator, record.user_id is always going to be your id. There is no way to supply a user_id parameter so completely unnecessary check

Comment on lines -166 to -173
describe do
let(:email) { 'Super.Boulette@hotmail.com' }

example 'Accept an invite using different capitalization for the email', document: false do
do_request
assert_status 200
end
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is still a valid test isn't it?

Comment on lines 9 to +10
roles { (project_ids || projects&.map(&:id)).uniq.map { |id| { type: 'project_moderator', project_id: id } } }
after(:build, &:confirm)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Might be nice to make the code here consistent with folder and space moderator

Comment on lines +48 to +49
context 'confirmed users with no password' do
let(:unconfirmed_user) { create(:unconfirmed_user) }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This does not make sense. Should you not create a confirmed user here?

Comment on lines 112 to 121
@@ -121,16 +120,6 @@
expect(User.exists?(user_id)).to be false
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know you did not write this test but think the test name is confusing. Maybe 'deletes the previous user if user has never confirmed their email address and they have a password' which I think is the logic in AuthenticationService.prevent_user_account_hijacking

Could also test be rewritten with :unconfirmed_user.

expect(user.confirmation_required?).to be(false)
end

context 'when email is not verified' do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
context 'when email is not verified' do
context 'when email is not confirmed' do

before { SettingsService.new.activate_feature!('user_confirmation') }

let(:invitee) { create(:user_with_confirmation, invite_status: 'pending') }
let(:invitee) { create(:unconfirmed_user, invite_status: 'pending') }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let(:invitee) { create(:unconfirmed_user, invite_status: 'pending') }
let(:invitee) { create(:invited_user) }

example_request 'Create JWT token with 1 day expiration' do
assert_status 201
example_request 'create JWT token with default expiration' do
expect(status).to eq(201)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(status).to eq(201)
assert_status 201

@jamesspeake
Copy link
Copy Markdown
Contributor

Just noticed there is a failing test too

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