Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-12794 remove effective user #10446

Merged
merged 12 commits into from
Apr 29, 2024
Merged

Conversation

theabrad
Copy link
Contributor

🎫 Ticket

LG-12794

🛠 Summary of changes

Removed EffectiveUserConcern and all references to effective_user

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Ensure that everything works correctly with effective user removed

@theabrad theabrad requested a review from a team April 16, 2024 16:01
@@ -73,7 +72,7 @@ def analytics
end

def analytics_user
effective_user || AnonymousUser.new
current_user || AnonymousUser.new
Copy link
Member

Choose a reason for hiding this comment

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

We need a solution here to make sure that in the hybrid flow we are not logging anonymous-id. I just did a quick test and we do in fact log anonymous-id if the hybrid flow is opened in a browser without a user logged in.

A few options:

  1. We can update this code to recognize we are in a hybrid flow session and select the correct user
  2. We can add an override to the hybrid flow methods to make sure analytics_user returns the user we are operating on

@theabrad theabrad requested review from a team and KeithNava April 19, 2024 19:53
hybrid_user || AnonymousUser.new
end

def hybrid_user
Copy link
Contributor

Choose a reason for hiding this comment

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

can we update the naming to something more reflective that this can be a current user or a hybrid user?

@@ -283,26 +283,6 @@
end
end

context 'with hybrid user' do
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we had this spec b/c a hybrid user can end up in the in person flow. What was the error that was observed before removing this spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error I was getting was enrollment on line 297 would end up being nil

Copy link
Contributor

Choose a reason for hiding this comment

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

@night-jellyfish - I'm hoping you might be able to id if we should still include a test for the hybrid flow?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a great question @svalexander ! The TLDR is that yes, I do believe we want to keep this test.

I had to do a lot of digging because I wasn't sure initially, and this part of the code has changed a lot in other work. In our workflow we don't end up going to the "try in person" option very often.

After that research I still wasn't sure, and I ended up testing it out locally. I found that yes - we do have the ability to search for post offices on the mobile side when in the hybrid flow, if ipp is enabled and we have an attention result. I believe that's what this is testing.

Unfortunately I'm not sure what to do about the user being nil in this code change. I think that would take me a good deal more research.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@night-jellyfish OK it is returning nil because I removed effective_user. We removed it because hybrid flow was only pertaining to uploading a photo and viewing if that was successful. If people also can look up USPS locations on the hybrid flow I might have to add something to check for doc_capture_user_id.

Copy link
Member

Choose a reason for hiding this comment

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

If the user is in the in-person flow, they need to be fully authenticated, right? effective_user was meant to support photo upload via phones only. Any other idv pages should be looking at current_user (unless i am missing something major about how IPP works)

@theabrad theabrad requested review from a team and night-jellyfish April 25, 2024 20:36
@@ -59,7 +59,7 @@ def proofer

def add_proofing_component
ProofingComponent.
create_or_find_by(user: effective_user).
create_or_find_by(user: current_or_hybrid_user).
Copy link
Member

Choose a reason for hiding this comment

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

This should probably just be current_user, right? Can someone from @18F/identity-joy confirm?

@@ -216,54 +216,6 @@
end
end

context 'with hybrid document capture' do
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand this test removal? Do we have coverage elsewhere for in-person starting in the hybrid flow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add it back in.

@theabrad theabrad merged commit 22e298c into main Apr 29, 2024
2 checks passed
@theabrad theabrad deleted the abrad-lg-12794-remove-effective-user branch April 29, 2024 15:13
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.

None yet

5 participants