You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Web - Login - Console error shows up after logging in #28042
There is no console error after successfully logging in.
Actual Result:
Console error shows up after logging in.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.73.0 Reproducible in staging?: y Reproducible in production?: n 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
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
I'm 99% sure this only happens for AuthenticatePusher calls where the channel name is private-report-reportID-null, which only happens if you have report_null in your Onyx data (which would have come from this issue which is now fixed). So no bad side-effects really and I think we can close.
Please re-state the problem that we are trying to solve in this issue.
Login - Console error shows up after logging in
What is the root cause of that problem?
At src/libs/action/Report.js#179, "reportId" has a string value which is "null". The if condition at line#179 fails, because if(!reportId) return false and the code does not return. And due to this, it's returning private-report-reportID-null string. In this, the null is due to reportId === "null". The Pusher api(http://localhost:8082/api?command=AuthenticatePusher) runs with channel_name: private-report-reportID-null and prints error of 404 on the console.
What changes do you think we should make in order to solve the problem?
You just have to change the if block condition with the below code on src/libs/action/Report.js#179.
if (!reportID || reportID === null) {
return;
}
or
if (!JSON.parse(reportID)) {
return;
}
Now the AuthenticatePusher will be execute with a valid reportId, and no error would be log in the console. It will not through 404 error in the Network tab
What alternative solutions did you explore? (Optional)
NA
@mallenexpensify I'm not sure if this is worth fixing, see my earlier comment. I don't think we really want to be handling having a report with a null ID.
@jjcoffee, @mallenexpensify Yes, this bug currently doesn't cause any problems for the app because the page redirects, but it's still showing up in the console. If the same code is used elsewhere in the app, it could crash the entire page(bcz of 404 error) if reportId is equal to null. It's a quick fix, only taking about 2 minutes.
So just to sum up in @JawadSadiq01's proposal we would be actively adding a check for a null reportID. This would handle cases where (as I understand it) we've optimistically added a report with a null ID (so you end up with report_null in Onyx) due to a typo that has since been fixed.
Personally I don't think this is worth handling, and I don't agree that it would cause a crash (pretty sure we would have seen reports of this too!). If we do want to fix, we can go with @JawadSadiq01's proposal. I'll leave it up to the engineer to make the final decision.
Activity
OSBotify commentedon Sep 22, 2023
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
StagingDeployCashdeploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:melvin-bot commentedon Sep 22, 2023
Triggered auto assignment to @tylerkaraszewski (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.mountiny commentedon Sep 25, 2023
I cannot repro, demoting
7 remaining items
melvin-bot commentedon Sep 25, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)mountiny commentedon Sep 25, 2023
Maybe its not repro and we can close it
jjcoffee commentedon Sep 25, 2023
I'm 99% sure this only happens for
AuthenticatePushercalls where the channel name isprivate-report-reportID-null, which only happens if you havereport_nullin your Onyx data (which would have come from this issue which is now fixed). So no bad side-effects really and I think we can close.JawadSadiq01 commentedon Sep 25, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Login - Console error shows up after logging in
What is the root cause of that problem?
At src/libs/action/Report.js#179, "reportId" has a string value which is "null". The if condition at line#179 fails, because if(!reportId) return false and the code does not return. And due to this, it's returning private-report-reportID-null string. In this, the null is due to reportId === "null". The Pusher api(http://localhost:8082/api?command=AuthenticatePusher) runs with channel_name: private-report-reportID-null and prints error of 404 on the console.
What changes do you think we should make in order to solve the problem?
You just have to change the if block condition with the below code on src/libs/action/Report.js#179.
or
Now the AuthenticatePusher will be execute with a valid reportId, and no error would be log in the console. It will not through 404 error in the Network tab
What alternative solutions did you explore? (Optional)
NA
See Attachment


melvin-bot commentedon Sep 29, 2023
@tylerkaraszewski, @mallenexpensify, @jjcoffee Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
mallenexpensify commentedon Oct 2, 2023
@jjcoffee please review @JawadSadiq01 's proposal above
#28042 (comment)
jjcoffee commentedon Oct 2, 2023
@mallenexpensify I'm not sure if this is worth fixing, see my earlier comment. I don't think we really want to be handling having a report with a null ID.
JawadSadiq01 commentedon Oct 2, 2023
@jjcoffee, @mallenexpensify Yes, this bug currently doesn't cause any problems for the app because the page redirects, but it's still showing up in the console. If the same code is used elsewhere in the app, it could crash the entire page(bcz of 404 error) if reportId is equal to null. It's a quick fix, only taking about 2 minutes.
melvin-bot commentedon Oct 2, 2023
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
jjcoffee commentedon Oct 4, 2023
So just to sum up in @JawadSadiq01's proposal we would be actively adding a check for a null
reportID. This would handle cases where (as I understand it) we've optimistically added a report with anullID (so you end up withreport_nullin Onyx) due to a typo that has since been fixed.Personally I don't think this is worth handling, and I don't agree that it would cause a crash (pretty sure we would have seen reports of this too!). If we do want to fix, we can go with @JawadSadiq01's proposal. I'll leave it up to the engineer to make the final decision.
🎀👀🎀 C+ reviewed
melvin-bot commentedon Oct 4, 2023
Current assignee @tylerkaraszewski is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
tylerkaraszewski commentedon Oct 4, 2023
I'm gonna close, it seems like this doesn't need to be fixed.