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

[$250] Onboarding - Free trial banner is displayed on archived admin room #55408

Open
2 of 8 tasks
IuliiaHerets opened this issue Jan 17, 2025 · 17 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Jan 17, 2025

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


Version Number: v9.0.87-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #53895
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: MacOS Chrome, mWeb
App Component: Other

Action Performed:

  1. Navigate to sign up page
  2. Sign up with a new email without "+" in it
  3. Select manage my team expenses > select any option > continue > select any integration option
  4. Delete the workspace
  5. Create a new workspace

Expected Result:

Free trail badge should be displayed on the newly created admin room of a workspace

Actual Result:

Free trail badge is displayed in the archived admin room

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6716745_1737124357927.Screen_Recording_2025-01-17_at_5.25.22_in_the_afternoon.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021881308660197614329
  • Upwork Job ID: 1881308660197614329
  • Last Price Increase: 2025-01-27
Issue OwnerCurrent Issue Owner: @eVoloshchak
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 17, 2025
Copy link

melvin-bot bot commented Jan 17, 2025

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jan 17, 2025

Proposal

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

Onboarding - Free trial banner is displayed on archived admin room

What is the root cause of that problem?

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

  • We should add && !optionItem.private_isArchived to the condition.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?


NA

What alternative solutions did you explore? (Optional)

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Jan 17, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-01-17 16:11:54 UTC.

🚨 Edited by proposal-police: This proposal was edited at 2025-01-17 16:11:54 UTC.

Proposal

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

Onboarding - Free trial banner is displayed on archived admin room

What is the root cause of that problem?

We are not checking if a report is archived or not for report header and lhn item

  1. Report header
    {!shouldUseNarrowLayout && isChatUsedForOnboarding && <FreeTrial pressable />}

{!isLoading && isChatUsedForOnboarding && shouldUseNarrowLayout && (

  1. LHN
    {isChatUsedForOnboarding(report, onboardingPurposeSelected) && <FreeTrial badgeStyles={[styles.mnh0, styles.pl2, styles.pr2, styles.ml1]} />}

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

We should check if the report is not archived in Report header and LHN using ReportUtils.isArchivedReport(report)

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

We can check if the report is archived here and return false if it is archived just above the return statment

App/src/libs/ReportUtils.ts

Lines 8589 to 8590 in efabde3

if (onboarding && !isEmptyObject(onboarding) && onboarding.chatReportID) {
return onboarding.chatReportID === optionOrReport?.reportID;

`ReportUtils.isArchivedReport(optionOrReport)1

Copy link
Contributor

⚠️ @etCoderDysto Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

@truph01
Copy link
Contributor

truph01 commented Jan 17, 2025

Proposal

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

  • Free trail badge is displayed in the archived admin room

What is the root cause of that problem?

  • The condition for displaying the free trial banner is defined here:

{isChatUsedForOnboarding(report, onboardingPurposeSelected) && <FreeTrial badgeStyles={[styles.mnh0, styles.pl2, styles.pr2, styles.ml1]} />}

  • It checks if the current report's id matches nvp_onboarding.chatReportID:

return onboarding.chatReportID === optionOrReport?.reportID;

  • The issue arises because when a workspace is deleted, all associated reports are also deleted. However, the nvp_onboarding.chatReportID value is not updated. As a result, the function isChatUsedForOnboarding continues to return true even though the report no longer exists.

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

  • The nvp_onboarding.chatReportID currently contains outdated data. As a workaround, we could add a check to verify if the admin report is an archived room in this function:

App/src/libs/ReportUtils.ts

Lines 8588 to 8590 in efabde3

// onboarding can be an empty object for old accounts and accounts created from olddot
if (onboarding && !isEmptyObject(onboarding) && onboarding.chatReportID) {
return onboarding.chatReportID === optionOrReport?.reportID;

  • However, addressing the root cause of the issue is preferable. The problem stems from nvp_onboarding.chatReportID storing outdated data. Specifically, when deleting a workspace and its associated rooms, we should check if the room matches the current nvp_onboarding.chatReportID. If it does, the value should be updated to null or undefined.

  • So in here, we can add:

        if (report?.reportID === onboarding?.chatReportID) {
            optimisticData.push({
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.NVP_ONBOARDING,
                value: {chatReportID: ''},
            });
        }
  • And we can revert the optimistic data in failure data.

  • Finally, update this:

    if (onboarding && !isEmptyObject(onboarding) && onboarding.chatReportID !== undefined) {
  • BE needs to handle it as well.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jan 20, 2025
@laurenreidexpensify laurenreidexpensify added the External Added to denote the issue can be worked on by a contributor label Jan 20, 2025
@melvin-bot melvin-bot bot changed the title Onboarding - Free trial banner is displayed on archived admin room [$250] Onboarding - Free trial banner is displayed on archived admin room Jan 20, 2025
Copy link

melvin-bot bot commented Jan 20, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021881308660197614329

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 20, 2025
Copy link

melvin-bot bot commented Jan 20, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

@melvin-bot melvin-bot bot removed the Overdue label Jan 20, 2025
@laurenreidexpensify
Copy link
Contributor

@eVoloshchak can you review the proposals please? thanks

@melvin-bot melvin-bot bot added the Overdue label Jan 22, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

@eVoloshchak, @laurenreidexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@laurenreidexpensify
Copy link
Contributor

@eVoloshchak bump ^^

@laurenreidexpensify
Copy link
Contributor

@eVoloshchak 👋 any updates thanks

Copy link

melvin-bot bot commented Jan 27, 2025

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Jan 28, 2025

@eVoloshchak, @laurenreidexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Jan 30, 2025

@eVoloshchak, @laurenreidexpensify 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Jan 31, 2025

@eVoloshchak @laurenreidexpensify 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!

@eVoloshchak
Copy link
Contributor

I think we should proceed with @truph01's proposal
We do indeed need the badge "position" to be synced across devices

when deleting a workspace and its associated rooms, we should check if the room matches the current nvp_onboarding.chatReportID. If it does, the value should be updated to null or undefined

I suspect that we don't need to delete the onboarding data if the user has already completed the onboarding

🎀👀🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Jan 31, 2025
Copy link

melvin-bot bot commented Jan 31, 2025

Triggered auto assignment to @tylerkaraszewski, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Status: No status
Development

No branches or pull requests

7 participants