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

[HOLD for payment 2024-07-26] [Closed & Archived] Extra spacing between last message and archived banner #45422

Closed
6 tasks
srikarparsi opened this issue Jul 15, 2024 · 17 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Weekly KSv2

Comments

@srikarparsi
Copy link
Contributor

srikarparsi commented Jul 15, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Follow up issue from here. More info in this comment.

You can reproduce by replacing this with return false so that the isArchivedRoom check doesn't rely on the fallback (which will be removed in a future PR).

Version Number:
Reproducible in staging?:
Reproducible in production?:
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
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

Action Performed:

Break down in numbered steps

  1. Create a workspace
  2. Send a message in a workspace chat (admins, announce...)
  3. Delete the workspace
  4. Navigate back to the workspace chat

Expected Result:

Describe what you think should've happened

There should be the right spacing between the last message and the archived banner in the footer
Say hello!

Actual Result:

Describe what actually happened

There is too much spacing between the last message and the archived banner in the footer
Say hello!

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @trjExpensify
@srikarparsi srikarparsi added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

Triggered auto assignment to @trjExpensify (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.

@devguest07
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Extra spacing between last message and archived banner

What is the root cause of that problem?

Margin top used as mt4

isArchivedRoom || isAnonymousUser || !canWriteInReport || (isAdminsOnlyPostingRoom && !isUserPolicyAdmin) ? styles.mt4 : {},

What changes do you think we should make in order to solve the problem?

Decrease the margin at the top

isArchivedRoom || isAnonymousUser || !canWriteInReport || (isAdminsOnlyPostingRoom && !isUserPolicyAdmin) ? styles.mt4 : {},

@srikarparsi
Copy link
Contributor Author

srikarparsi commented Jul 15, 2024

@DylanDylann you can reproduce by replacing this with return false so that the isArchivedRoom check doesn't rely on the fallback (which will be removed in a future PR).

function isArchivedRoom(report: OnyxInputOrEntry<Report>, reportNameValuePairs?: OnyxInputOrEntry<ReportNameValuePairs>): boolean {
    if (reportNameValuePairs) {
        return reportNameValuePairs.private_isArchived;
    }

    return false;
}

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 15, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Extra spacing between last message and archived banner

What is the root cause of that problem?

hideComposer is false in ReportActionsList.tsx even when composer is hidden and shouldHideComposer in ReportFooter.tsx is correctly set as true when composer is hidden. In ReportActionsList.tsx we apply padding top when !hideComposer is true and !hideComposer produces true even if the report is archived.

const hideComposer = !ReportUtils.canUserPerformWriteAction(report);

const shouldHideComposer = (!ReportUtils.canUserPerformWriteAction(report, reportNameValuePairs) && !shouldShowComposerOptimistically) || isBlockedFromChat;

<Animated.View style={[animatedStyles, styles.flex1, !shouldShowReportRecipientLocalTime && !hideComposer ? styles.pb4 : {}]}>

What changes do you think we should make in order to solve the problem?

!hideComposer should return false when report is archived, we should make it consistent with shouldHideComposer in ReportFooter.tsx. We can refactor and create a new function to use in ReportActionsList.tsx and ReportFooter.tsx or we can just do same as in ReportFooter.tsx to get the correct value of hideComposer.

    const [isBlockedFromChat] = useOnyx(ONYXKEYS.NVP_BLOCKED_FROM_CHAT, {
        selector: (dateString) => {
            if (!dateString) {
                return false;
            }
            try {
                return new Date(dateString) >= new Date();
            } catch (error) {
                // If the NVP is malformed, we'll assume the user is not blocked from chat. This is not expected, so if it happens we'll log an alert.
                Log.alert(`[${CONST.ERROR.ENSURE_BUGBOT}] Found malformed ${ONYXKEYS.NVP_BLOCKED_FROM_CHAT} nvp`, dateString);
                return false;
            }
        },
    });

    const [isAnonymousUser = false] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.authTokenType === CONST.AUTH_TOKEN_TYPES.ANONYMOUS});
    const shouldShowComposerOptimistically = !isAnonymousUser && ReportUtils.isPublicRoom(report) && !!reportMetadata?.isLoadingInitialReportActions;
    const shouldHideComposer = (!ReportUtils.canUserPerformWriteAction(report, reportNameValuePairs) && !shouldShowComposerOptimistically) || isBlockedFromChat;

reportMetadata and reportNameValuePairs can be passed down to ReportActionsList from ReportScreen or we can obtain that from onyx.

What alternative solutions did you explore? (Optional)

@trjExpensify
Copy link
Contributor

Is @DylanDylann implementing this as a follow-up to his PR?

@trjExpensify trjExpensify changed the title Extra spacing between last message and archived banner [Closed & Archived] Extra spacing between last message and archived banner Jul 15, 2024
@srikarparsi
Copy link
Contributor Author

Yes, that's the goal. It was a bug I found from the PR but thought it would be better to handle as a follow up so that we could merge without conflicts.

@trjExpensify
Copy link
Contributor

Great! @DylanDylann can you raise the PR please?

@DylanDylann
Copy link
Contributor

Yeah, The PR will be ready soon

@trjExpensify
Copy link
Contributor

Did we get a PR up for this?

@DylanDylann
Copy link
Contributor

I am working on it

@DylanDylann
Copy link
Contributor

@srikarparsi After investigating, It seems this bug isn't regression from my PR

The RCA: In #40661, we add reportNameValuePairs argument to canUserPerformWriteAction function but we don't add reportNameValuePairs param when using canUserPerformWriteAction function in some places

My solution: Removing reportNameValuePairs argument in canUserPerformWriteAction function. Getting reportNameValuePairs in canUserPerformWriteAction function directly

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 17, 2024
@DylanDylann
Copy link
Contributor

@srikarparsi The PR is up #45588

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 19, 2024
@melvin-bot melvin-bot bot changed the title [Closed & Archived] Extra spacing between last message and archived banner [HOLD for payment 2024-07-26] [Closed & Archived] Extra spacing between last message and archived banner Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.9-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-26. 🎊

For reference, here are some details about the assignees on this issue:

  • @DylanDylann requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jul 19, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
  • [@DylanDylann] 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:
  • [@DylanDylann] A discussion in #expensify-bugs 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:
  • [@DylanDylann] Determine if we should create a regression test for this bug.
  • [@DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@srikarparsi
Copy link
Contributor Author

The payment for this will be taken care of in this issue since it was brought up in this comment. Does that sound right @DylanDylann?

@DylanDylann
Copy link
Contributor

Yes. Let's close this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants