Closed lanitochka17 closed 1 month ago
Triggered auto assignment to @sakluger (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@sakluger FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Job added to Upwork: https://www.upwork.com/jobs/~013152861e0170f045
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf (External
)
Edited by proposal-police: This proposal was edited at 2024-08-15 07:29:48 UTC.
'Unavailable workspace ' appears when a User attempts to login with a fresh Gmail account.
Within HeaderView.ts
we invoke 1getPolicyName function to get the sub-heading. Note: We send true for returnEmptyIfNotFound
flag.
https://github.com/Expensify/App/blob/main/src/pages/home/HeaderView.tsx#L113
Within the getPolicyName
function, when there report has no policies (This happens when it's a new user), we don't respect the returnEmptyIfNotFound
flag.
https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L745
Replace
if ((!allPolicies || Object.keys(allPolicies).length === 0) && !report?.policyName) {
return unavailableTranslation;
}
With
if ((!allPolicies || Object.keys(allPolicies).length === 0) && !report?.policyName) {
return noPilicyFound;
}
The noPolicyFound
variable (link) take's care of respecting the returnEmptyIfNotFound
flag.
@sakluger, @allgandalf Whoops! This issue is 2 days overdue. Let's get this updated quick!
@jainilparikh can you dig in more? I don't think your solution is correct, maybe git blame and check why that text was added there at the first place? thanks
Hi @allgandalf, Sorry if my proposal is confusing, but to be clear, I am not asking to remove the text, my solution states that we replace the text with a variable noPolicyFound
. That variable decides which text to use based on returnEmptyIfNotFound
:
https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L659
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@jainilparikh i am asking why do we return Localize.translateLocal('workspace.common.unavailable')
at the first place? can you check why that check was added at the first place
@sakluger, @allgandalf Whoops! This issue is 2 days overdue. Let's get this updated quick!
bump to @jainilparikh to address the comment ^, I will post on the Open Source channel if i don't get any proposal next time melvin add overdue
@sakluger @allgandalf this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Issue not reproducible during KI retests. (First week)
I also was unable to reproduce this. Closing.
Issue is still reproducible on the latest build v9.0.19-9, unavailable workspace appears for a moment before the Onboarding modal opens
https://github.com/user-attachments/assets/122db380-4bb0-41d9-b0a4-a8ff4ca1b920
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@jainilparikh are you still interested in working on this one?
If they are interested then @jainilparikh can you please try to address this comment, thanks π
Yes, taking a look sorrry for the late response.
So, to answer your query:
@jainilparikh i am asking why do we return Localize.translateLocal('workspace.common.unavailable') at the first place? can you check why that check was added at the first place
This was added as a default response by the original author of the getPolicyName function ( I don't think the author had any other intentions for this string other than acting as a fallback when there are no policies):
The original author just assumed that sending 'workspace.common.unavailable' would be the right response when there is no policy associated with a user. Multiple refactors were done after this, but in all of them, this default response was untouched.
If we were to go futher back in history, this string was called 'unknown Policy': https://github.com/Expensify/App/pull/7957/files#diff-82f2652821babb48b600a87486fa1191db7b3cc300845573a5757676e13cfc26L176 Which was replaced with 'unavailable workspace'.
TLDR: I don't think replacing it will cause a regression.
Please let me know if there are any other questions. Thanks!
@allgandalf , any further questions ?
I will review this today β»οΈ
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@allgandalf any updates?
Okay the issue is only for the first time when we login with new account, it doesn't happen when we complete onboarding, it only happens in the transition of log in and the onboarding modal appears:
https://github.com/user-attachments/assets/7346423e-a63a-46e9-9bf1-6256ea72c738
https://github.com/user-attachments/assets/a1792cd6-27e1-44ab-bfd5-726092175d7b
Also @jainilparikh's RCA is not correct, we return noPolicyFound
only when the report
is empty object and when we create a new account for a second report
is not considered as empty object, so I will post on slack for some π and also would like if @jainilparikh can dig deeper into this
@allgandalf if someone can better explain the root cause but ended up with similar other proposal solution, which proposal will be selected?
Edited by proposal-police: This proposal was edited at 2023-10-07T14:19:29Z.
Web - Concierge - Concierge in unavailable workspace when create new account
The real problem relies in the ReportScreen
component where we're rendering HeaderView
component.
Inside ReportScreen
component we're rendering HeaderView
with a prop report
which is a object derives from object read from onyx
The case which the issue is reproducible is where this object contains all the keys but all the values inside are undefined
in which it passes the first if
condition inside getReportName
function.
Now after the if
we have another condition where we're checking the polices
from onyx and verifying that the report isn't from one of the policies.
When we create a new account, allReports
will be empty and report.policyName
is also undefined
which qualifies this condition and here we're returning the Unavailable Workspace
string.
This happens with-in micro-seconds of time diff on writing the data to onyx and component re-render.
To summarize the first if
condition is failing because we're not sending an empty object from ReportScreen
whereas the 2nd condition is getting succeed because of the time-diff of getting updated data i.e report
and allReports
which is giving the unavailableTranslation
.
We can simply return noPolicyFound
from 2nd if
condition which will return empty string in this cause because returnEmptyIfNotFound
is true.
We need to make sure the
returnEmptyIfNotFound
is respected everywhere in the codebase to make sure we don't cause any regressions.
Currently we have policyId
condition _FAKE_
value in-case of empty policy related to report. We can also do same for policyName
and return _FAKE_
value from ReportScreen
component and have a condition inside getReportName
function to handle it carefully.
We should only send
_FAKE_
value if thepolicyName
doesn't exist fromreport
which doesn't exist forconceirge
andexpensify
's report.
Gentle bump @allgandalf for proposal review :)
Web Concierge is unavailable for a brief moment when creating a new account.
On the initial login, there is a moment that report and policies are being loaded and we call getPolicyName
When the policies empty and loading then it will enter this check:
This can happen for new account or existing one.
Add !report.reportID || isEmptyObject(allPolicies)
to this check:
We can also refactor (!allPolicies || Object.keys(allPolicies).length === 0)
to isEmptyObject(allPolicies)
here:
Alternative 1
define isConcierge chat as one of kind of chat that not need to display renderAdditionalText
Chang this code to:
const renderAdditionalText = () => {
if (isConciergeChat || shouldShowSubtitle() || isPersonalExpenseChat || !policyName || !isEmptyObject(parentNavigationSubtitleData) || isSelfDM) {
return null;
}
Alternative 2 I am unsure when the unavailable workspace is supposed to appear and cannot find sufficient information, but I suggest removing that option entirely and displaying an empty string for all cases where it is not found.
Alternative 3 Similar to prev proposals but with optimization to condition
in getPolicyName
const noPolicyFound = returnEmptyIfNotFound ? '' : unavailableTranslation;
if (isEmptyObject(report)||(isEmptyObject(allPolicies) && !report?.policyName) ) {
return noPolicyFound;
}
const finalPolicy = policy ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];
const parentReport = getRootParentReport(report);
Issue not reproducible during KI retests. (Second week)
Hey @allgandalf could you please review the outstanding proposals?
I'm also going to add another BZ member to monitor while i'm OOO (Back 8/30).
Triggered auto assignment to @lschurr (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@sakluger, @lschurr, @allgandalf Whoops! This issue is 2 days overdue. Let's get this updated quick!
Any update here @allgandalf?
Bumped in Slack as well - https://expensify.slack.com/archives/C01GTK53T8Q/p1724859115299129
Sorry, didn't show up on K2, I will review this one today/tomorrow
Long overdue, reviewing today β»οΈ
Thanks for the proposals everyone,
@jainilparikh:
Thanks for the proposal, but your RCA was not clear and correct from the start.
@b4s36t4 & @wildan-m , I appreciate you guys digging deep into the RCA, the root cause is much clear now.
Although both @b4s36t4 and @wildan-m proposed solution would solve the bug, I would like to go with @wildan-m main solution here, the proposed condition makes more sense to me
πππ C+ reviewed
Triggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
bump to @cristipaval π
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
friendly bump @cristipaval
NO melvin, not overdue π
@cristipaval is out on leave - going to put this in Slack to get another Engineer added.
Let's just auto-assign a new engineer.
Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.
@allgandalf do you mind posting "πππ C+ reviewed" again to get a new engineer auto-assigned? Thanks!
sure thing @sakluger ! was about to suggest thatβ¦.
πππ C+ reviewed
If you havenβt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.2-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: N/A Email or phone of affected tester (no customers): gocemate+a444@gmail.com Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
There should be only Concierge label on Concierge chat header
Actual Result:
"Concierge in unavailable workspace" can be seen on the Concierge chat header after creating a new account
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @cristipaval