-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[REPORTING PAYMENT][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in #26615
Comments
Triggered auto assignment to @jliexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
@adeel0202 @kbecciv on v1.3.62-3, I can reproduce part of this issue - basically, the part I cannot reproduce is showing the Magic Link details prefilled. On the newest staging version, I see this: However, leaving the room and opening a new tab and using the URL still shows a "Sign In" button - I think this should be fixed, since you shouldn't need to sign in again as all you've done is left the room. |
Job added to Upwork: https://www.upwork.com/jobs/~0164d1ccb8bef91f4d |
Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in What is the root cause of that problem?The method in which we check to hide the composer and show sign in button is unreliable, there is no doubt here that we are facing a backend issue where leaving a room in some cases will result in session.authTokenType being returned by the backend as "anonymousAccount" and I believe that should be addressed on an internal level, however I think we should also address this on frontend level to avoid this kind of behaviour in the future as relying on authTokenType isn't the best idea when we have access to two more unique items that will be available when the user is signed in which are CREDENTIALS.login and CREDENTIALS.validateCode. What changes do you think we should make in order to solve the problem?We should refrain from using authTokenType and start using CREDENTIALS when we are checking for credentials as is the case with checking if isAnonymousUser, to do this we can make a change to session.isAnonymousUser to use these credentials for the check. function isAnonymousUser() {
return !lodashGet(credentials, 'login') && !lodashGet(credentials, 'validateCode');
} Another thing we can change is ReportUtils.shouldDisableWriteActions which uses isAnonymousUser that it calls itself from Onyx which is not good for keeping the code DRY as we are already connecting to the exact same part of Onyx in Session component so we can simply change the check for shouldDisableWriteActions to use the same Session.isAnonymousUser function. function shouldDisableWriteActions(report) {
const reportErrors = getAddWorkspaceRoomOrChatReportErrors(report);
return isArchivedRoom .. || Session.isAnonymousUser(); // Changing from local variable to calling Session component
} ResultScreen.Recording.2023-09-04.at.3.16.19.AM.mov |
Please re-state the problem that we are trying to solve in this issue.Opening #teachers-unite room directly through the link shows sign in option even when signed in What is the root cause of that problem?The root cause of the problem is the unreliability of the method used to decide whether to show the signup modal in the frontend of the application. The issue is exacerbated by inconsistent data returned from the backend, specifically the session.authTokenType. This inconsistency occurs when leaving a room, resulting in session.authTokenType being sometimes incorrectly set to 'anonymousAccount'. What changes do you think we should make in order to solve the problem?To address this issue effectively, we propose a solution that involves both frontend and potentially backend adjustments: Frontend Solution: Enhance Authentication Checks: Instead of relying solely on Modify the
Update the
Backend Solution (if necessary): Address Backend Inconsistencies: Investigate and address the root cause of the backend inconsistency where leaving a room results in an Video: |
Not overdue, but @sobitneupane we have some proposals rolling in! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Opening the #teachers-unite room directly through the link shows sign in option even when signed What is the root cause of that problem?authTokenType = 'anonymousAccount' not removing from onyx state What changes do you think we should make in order to solve the problem?we should be update the backend passing the empty string for update the onyx //successData
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.SESSION,
value: {
authTokenType:'',
},
}, we need update all signin call SigninUser, apple signin, googlesignin this ONYX BUG: @sobitneupane if you want i will fix this on ONYX repo |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@sobitneupane, @jliexpensify Huh... This is 4 days overdue. Who can take care of this? |
Thanks for the proposal everyone. @pradeepmdk Would you mind explaining your proposal. I am trying to understand your proposal. But I am not sure if I am getting your point.
Where are we calling |
@sobitneupane yes this is bug Onyx. we are not calling anywhere as mentioned in my screenshot after signing successfully API sends sending Onyx merge command with Screen.Recording.2023-09-11.at.1.52.08.PM.movthis is the ref of the merge command in Onyx. because API is sending the merge command right .so i am trying to explain here merge command has this issue. |
@sobitneupane already we have PR for this fix Expensify/react-native-onyx#333 we should wait for merging after the upgrade of the onyx lib so this will work. |
Thanks for the update @pradeepmdk. Let's hold this issue for now. We can come back and check after Expensify/react-native-onyx#333 gets merged. cc: @jliexpensify |
Sure thing @sobitneupane and @pradeepmdk - bump me when you want this taken off hold! |
Still on hold |
@sobitneupane this is fixed on this version 1.0.89. can I raise the pr for the upgraded version? |
@pradeepmdk I don't think we need to raise PR here. I will be raised in the associated issue for which PR was raised. |
@sobitneupane this issue was solved only when we upgraded React native Onyx version 1.0.89. |
We will wait for it to update from the associated issue. |
@sobitneupane Actually I only commented on that. based on my comment they raised the another PR. |
@sobitneupane this is fixed now. |
@pradeepmdk thanks for letting us know. Just tried on v1.3.78-4 and can verify it's fixed. Going to pay @adeel0202 for reporting and then close this out. |
Payment Summary
|
Paid, job closed! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The sign-in option should not be displayed
Actual Result:
The sign-in option is displayed. Also, the sign-in modal still has the previously entered magic code (Note: this may not be reproducible on the newest version - #26615 (comment))
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.62.0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-08-30.at.12.51.28.PM.mov
Recording.4216.mp4
Expensify/Expensify Issue URL:
Issue reported by: @adeel0202
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693382434318589
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: