Open iwiznia opened 3 weeks ago
Triggered auto assignment to @jliexpensify (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.
Edited by proposal-police: This proposal was edited at 2024-11-05 14:18:22 UTC.
RBR is shown on paid report previews
We show the RBR on ReportPreview only based on the shouldShowRBR
, not like in MoneyRequestPreviewContent where we show the RBR if the shouldShowRBR
is true
and the isSettled
is false
Only show RBR if not settled, like we did in MoneyRequestPreviewContent
{!iouSettled && shouldShowRBR && (
<Icon
src={Expensicons.DotIndicator}
fill={theme.danger}
/>
)}
We show the RBR without settled check in workplace chat
You can see in my first screenshot that the settled check is shown in the workspace chat report preview
@iwiznia ohh, I mean here we dont include the settled check, updated my proposal to make the RCA more clear
Ah ok, that's not correct as that would mean we never show RBR when settled, which is wrong.
Edited by proposal-police: This proposal was edited at 2024-11-20 23:15:32 UTC.
LHN - RBR stays for paid report
In all MoneyRequestPreview, MoneyReportView and LHN RBR we are showing RBR whenever there is a report or transaction violations without checking if the report is settled one https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/ReportPreview.tsx#L168-L170 https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx#L112 https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/LHNOptionsList/OptionRowLHNData.tsx#L40
We will need to make two changes according to the new summary given as all other parts of the summary are already included in our current code base
Red dots appear on expense report and transaction preview components as long as violations/rules have been broken and the report is not reimbursed or closed.
const shouldDisplayReportViolations = !ReportUtils.isSettled(fullReport) && ReportUtils.isReportOwner(fullReport) && ReportUtils.hasReportViolations(reportID);
{shouldShowRBR && !iouSettled && (
we can also add ReportUtils.isClosedReport
check if needed
@iwiznia We had this issue here and closed without fixing it, so re-commented the proposal here too.
Thanks @FitseTLT - waiting on @iwiznia to review your comment.
Job added to Upwork: https://www.upwork.com/jobs/~021854179900043130166
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External
)
Contributor details
Your Expensify account email: legranddexter08@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01166a125bd57d0627
I will modify the RBR logic to include a conditional check on the expenseβs payment status and then update the logic so that if an expense is marked as paid, the RBR indicator is suppressed across all views, including the workspace chat.
This can be achieved by adding a paymentStatus
validation in the RBR component or middleware responsible for handling expense flags. For instance, ensure that the RBR check only applies when paymentStatus !== 'PAID'
.
And I can implement a centralized function or service that determines when to display the RBR flag, standardizing its behavior across different parts of the application (workspace chat, expense previews, and expense page).
This service can be a function named like shouldDisplayRBR
, which evaluates criteria such as isPaid
, hasPolicyViolation
, and any other relevant flags. All parts of the UI that display the RBR can then call this centralized function, ensuring consistency.
If the workspace chat updates asynchronously or in real-time, it is important to ensure that any change in the expenseβs status triggers an update in the workspace chat as well. In that case, I need to use websockets to keep the RBR status in sync with the expense's current state.
And I will review the rendering conditions for RBR flags in each part of the UI. In my experience, many systems experiences inconsistencies due to scattered conditions across components. So I can refactor the RBR rendering logic to leverage a single source of truth if necessary.
By implementing these changes, I can make the RBR indicator behaves consistently and aligns with the expected functionality.
π£ @dexterlegrand! π£ Hey, it seems we donβt have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@jliexpensify, @ikevin127 Eep! 4 days overdue now. Issues have feelings too...
We had a similar issue here which was closed as NAB:
the consensus there was that it is expected to still have RBR show because of existing violations, see https://github.com/Expensify/App/issues/48400#issuecomment-2367773018:
- The red circle on showing on the report preview is working as intended, because the report has violations and we show that no matter what the state of the report is.
- After paying, the red circle should remain in the report preview, for the same reason as in the first bullet
- After clearing the cache, the report preview isn't showing the red circle, and after clicking on the preview, the transaction previews aren't showing the red circle. These are bugs because they should be showing for the same reason as in the first bullet
The https://github.com/Expensify/App/issues/48400#issuecomment-2390337662 that the issue was closed with:
From this https://github.com/Expensify/App/issues/48400#issuecomment-2367773018, seems part of the behavior is expected. Closing it out for now, but we can re-open if it's reported again as an issue
In case this issue is a dupe of that then I think we're good to close it as NAB - but otherwise if I'm missing something and this one is different then I think I'll have to start reviewing the proposals ? Please let me know!
cc @jliexpensify @iwiznia
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@iwiznia thoughts on this? I agree that the red dots are confusing, but also can understand @cead22's point here:
The red circle on showing on the report preview is working as intended, because the report has violations and we show that no matter what the state of the report is.
Not overdue, waiting on input regarding https://github.com/Expensify/App/issues/52037#issuecomment-2469171616 before moving forward with the issue.
Oh @JmillsExpensify was going to post a summary of a discussion we had summarizing how this should work.
@jliexpensify, @ikevin127 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue, still waiting on input regarding https://github.com/Expensify/App/issues/52037#issuecomment-2469171616 before moving forward with the issue.
@jliexpensify @ikevin127 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!
@iwiznia I still have this one on my list. Should I post the summary in this issue or create a new one?
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
Here sounds good to me
Awaiting on summary to be posted coming from https://github.com/Expensify/App/issues/52037#issuecomment-2488894910 so we can move forward with the issue.
Ok I'll prioritize that now.
I think this is where we landed.
RBR - Exclusively refers to reports that are marked as unread and are visible in the LHN. RBRed rows in the LHN carry a red dot and are also always pinned.
Red dot - Refers to a pattern of using a red circle incon βΒ on expenses, reports, in settings, etc. Red dots disappear when either an X
has been clicked, an issue with an expense has been resolved, or an expense report has been paid.
Red text - Red words that appears in the transaction thread, next to whatever field has broken an amount (e.g. Missing category
or Receipt required
).
Workspace chat - policyExpenseChat
Preview component - The "boxes" or "cards" that appear for reports or transactions. Clicking a preview component shows the report or transaction details.
Submitters
reimbursed
or closed
.Red violation/rule text always appear in the transaction thread, no matter the state of the report it's on
Approvers and admins
reimbursed
or closed
.Most of the changes align with current code so Updated proposal to include the missing checks π
I was able to reproduce the issue following these steps:
[!tip]
- Submit two failing scan expenses to another account (you have access to), this can be done by adding a picture that it's not an actual receipt such that the scan would fail and the expenses Amount is $0 -> violation asking to input Amount.
- Navigate to one of the failed scan expenses and input the Amount -> which would fix the violation of the expense.
- Login into the other account and pay the expenses via
Pay elsewhere
for both expenses (including the one with pending violation).- Back on the expenses submitter side, in the report with the other account where the groupped expenses can be seen, notice that RBR is showing whlist if clicked on the preview and seeing the expenses separately, no RBR can be seen.
@JmillsExpensify @iwiznia If any of you think that I'm missing a certain flow like WS related expenses, please let me know the steps and will make sure to double check that the selected proposed solution is covering the fix for that flow as well.
@FitseTLT Any specific reason for adding the second check here:
instead of here ?
If not, I'd say let's add it there as a way to centralize the shouldShowRBR
variable at the component level instead of keeping it separate and adding !iouSettled
only for the RBR icon, as shouldShowRBR
is also used below to display the GBR indicator.
I see a RBR in the workspace chat but not in the expense previews in it There are indeed violations in the expenses though as shown in the expense page. but they should not show the RBR in the workspace chat, since it is already paid.
Assuming the Expected result of the issue is to not show the RBR on expense group if the expenses are paid (settled) and given the latest specifications are reinforcing that, let's go with @FitseTLT's proposal as the RCA is correct and the solution fixes the issue.
πππΒ C+ reviewed
Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@ikevin127 that sounds good to me. In terms of testing, it'd also be easy to manually create an expense and then trigger one of the standard violations that get set when the policy is created ($2k individual expense, $25 receipt required amount, etc.).
cc @grgia for visibility
π£ @ikevin127 π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @FitseTLT π An offer has been automatically sent to your Upwork account for the Contributor role π Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
Looks good, assigning!
Going to assign myself as BZ in case follow-on discussion comes up
cc @grgia for visibility as we're awaiting PR review
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.68-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-12-07. :confetti_ball:
For reference, here are some details about the assignees on this issue:
@ikevin127 @JmillsExpensify @ikevin127 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[x] [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: No specific offending PR as our issue's edge case was simply not considered during implementation.
[x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A.
[x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[ ] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Do we agree π or π.
I see a RBR in the workspace chat but not in the expense previews in it There are indeed violations in the expenses though as shown in the expense page. but they should not show the RBR in the workspace chat, since it is already paid.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @JmillsExpensify