Skip to content

[$125] [Report Creation UI] Expense - After adding track expense to workspace report, actionable whisper is still present #61998

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

Open
8 tasks done
jponikarchuk opened this issue May 14, 2025 · 32 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@jponikarchuk
Copy link

jponikarchuk commented May 14, 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: 9.1.45-6
Reproducible in staging?: Yes
Reproducible in production?: Unable to check, new feature
If this was caught during regression testing, add the test name, ID and link from TestRail: #61760
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Account has self DM and a workspace.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Track a manual expense in self DM. Do not dismiss the actionable whisper.
  4. Go to workspace chat.
  5. Submit an expense.
  6. Click on the expense preview.
  7. Click More.
  8. Click Add expense > Add unreported expense.
  9. Select the track expense from Step 3.
  10. Click Add to report.
  11. Go back to self DM.

Expected Result:

Actionable whisper will no longer appear because the track expense is moved to a workspace expense and no longer in self DM.

Actual Result:

Actionable whisper is still present when the track expense is no longer in self DM.
When trying to submit the track expense via actionable whisper, it is stuck at the confirmation page.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021927834364028511748
  • Upwork Job ID: 1927834364028511748
  • Last Price Increase: 2025-05-28
  • Automatic offers:
    • allgandalf | Reviewer | 107488255
    • nkdengineer | Contributor | 107488256
Issue OwnerCurrent Issue Owner: @nkdengineer
@jponikarchuk jponikarchuk added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels May 14, 2025
Copy link

melvin-bot bot commented May 14, 2025

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

Copy link

melvin-bot bot commented May 14, 2025

Triggered auto assignment to @Gonals (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label May 14, 2025
Copy link

melvin-bot bot commented May 14, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 14, 2025
Copy link
Contributor

👋 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@SzymczakJ
Copy link
Contributor

With this PR(#62004) this button will be hidden behind a beta, so I think we can demote this deploy blocker and me or @sumo-slonik will work on the fix. cc @mountiny @luacmartins

@trjExpensify trjExpensify changed the title Expense - After adding track expense to workspace report, actionable whisper is still present [Report Creation UI] Expense - After adding track expense to workspace report, actionable whisper is still present May 14, 2025
@trjExpensify trjExpensify moved this to Second Cohort - HIGH in [#whatsnext] #migrate May 14, 2025
@trjExpensify
Copy link
Contributor

Demoting after the CP

@trjExpensify trjExpensify removed the DeployBlockerCash This issue or pull request should block deployment label May 14, 2025
@Gonals Gonals added Daily KSv2 and removed Hourly KSv2 labels May 14, 2025
@SzymczakJ
Copy link
Contributor

Comming from this discussion(and my personal opinion) the deletion of actionable whisper should be performed on BE along with the ChangeTransactionReport API call.
Can we create an issue for that? cc @luacmartins @mountiny

@trjExpensify
Copy link
Contributor

I don't think we need a new issue, we can just use this one. Who's going to take it though? 👍

@mountiny
Copy link
Contributor

Will have to query for the report action with this transactionID in the message on selfDM and remove it https://github.com/Expensify/Auth/blob/5aaf785f52a3cab14972065450e0484bbf1c6b4b/auth/lib/ReportAction.cpp#L3206

@mountiny
Copy link
Contributor

I tested today and indeed its not being removed, although it temporarily hides and reappears later. Auth tests confirm its deleted though, I need to dig a bit more into this specific flow

@mountiny
Copy link
Contributor

I am super confused on this one as I can see the tests are passing in the auth and also logging if the action is deleted, I can confirm its marked as deleted, but then its back... some gremlins here

@mountiny
Copy link
Contributor

ooooo just saw whats wrong:

2025-05-28 20:20:00.367  1421888702483712  1          ACTIONABLETRACKEXPENSEWHISPER  {"html":"What would you like to do with this expense?","isNewDot":true,"lastModified":"2025-05-28 20:20:00.367","transactionID":"3240052077208767397","deleted":"2025-05-28 20:20:26.128"}  9179578699730873052

It is deleted correctly but probably the logic for these actions in the app does not handle the deleted correctly

@mountiny
Copy link
Contributor

Confirmed testing in staging the action has the deleted prop so its App issue and we are not correctly hiding the whisper when its deleted

Image

@mountiny mountiny added External Added to denote the issue can be worked on by a contributor and removed Reviewing Has a PR in review labels May 28, 2025
@melvin-bot melvin-bot bot changed the title [Report Creation UI] Expense - After adding track expense to workspace report, actionable whisper is still present [$250] [Report Creation UI] Expense - After adding track expense to workspace report, actionable whisper is still present May 28, 2025
Copy link

melvin-bot bot commented May 28, 2025

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

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

melvin-bot bot commented May 28, 2025

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

@mountiny mountiny changed the title [$250] [Report Creation UI] Expense - After adding track expense to workspace report, actionable whisper is still present [$125] [Report Creation UI] Expense - After adding track expense to workspace report, actionable whisper is still present May 28, 2025
Copy link

melvin-bot bot commented May 28, 2025

Upwork job price has been updated to $125

@mountiny
Copy link
Contributor

Solution:

Ensure that when ACTIONABLETRACKEXPENSEWHISPER (and any other action) has the message.deleted set, the message is handled as deleted

@nkdengineer
Copy link
Contributor

Proposal

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

Actionable whisper is still present when the track expense is no longer in self DM.
When trying to submit the track expense via actionable whisper, it is stuck at the confirmation page.

What is the root cause of that problem?

The problem is isDeletedAction function doesn't cover the case the deleted is on originalMessage data then the action is still visible.

const isDeleted = isDeletedAction(reportAction);

function isDeletedAction(reportAction: OnyxInputOrEntry<ReportAction | OptimisticIOUReportAction>): boolean {
if (isInviteOrRemovedAction(reportAction)) {
return false;
}
const message = reportAction?.message ?? [];
if (!Array.isArray(message)) {
return message?.html === '' || !!message?.deleted;
}
// A legacy deleted comment has either an empty array or an object with html field with empty string as value
const isLegacyDeletedComment = message.length === 0 || message.at(0)?.html === '';
return isLegacyDeletedComment || !!message.at(0)?.deleted;

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

Update isDeletedAction to cover the deleted that exists in originalMessage data

const originalMessage = getOriginalMessage(reportAction);
return isLegacyDeletedComment || !!message.at(0)?.deleted || (!!originalMessage && 'deleted' in originalMessage && !!originalMessage?.deleted);

function isDeletedAction(reportAction: OnyxInputOrEntry<ReportAction | OptimisticIOUReportAction>): boolean {
if (isInviteOrRemovedAction(reportAction)) {
return false;
}
const message = reportAction?.message ?? [];
if (!Array.isArray(message)) {
return message?.html === '' || !!message?.deleted;
}
// A legacy deleted comment has either an empty array or an object with html field with empty string as value
const isLegacyDeletedComment = message.length === 0 || message.at(0)?.html === '';
return isLegacyDeletedComment || !!message.at(0)?.deleted;

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

Update isDeletedAction test to cover this scenario.

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@SzymczakJ
Copy link
Contributor

Proposal looks good 👍

@allgandalf
Copy link
Contributor

Lets go with @nkdengineer proposal then

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 29, 2025

Current assignee @mountiny is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 29, 2025
Copy link

melvin-bot bot commented May 29, 2025

📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented May 29, 2025

📣 @nkdengineer 🎉 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 📖

@mountiny
Copy link
Contributor

@nkdengineer can you please raise the PR?

@nkdengineer
Copy link
Contributor

@mountiny Sure will raise the PR soon.

@mountiny
Copy link
Contributor

Not sure why we even consider the message in this case as the deleted prop should be in the originalMessage all the time

@nkdengineer
Copy link
Contributor

@allgandalf The PR is ready for review.

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Second Cohort - HIGH
Development

No branches or pull requests

9 participants