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

[$4000] Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction #15863

Closed
1 of 6 tasks
kavimuru opened this issue Mar 10, 2023 · 32 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering 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

@kavimuru
Copy link

kavimuru commented Mar 10, 2023

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


Action Performed:

  1. Go to Web chrome
  2. Go to any chat
  3. Upload an image file with 2MB+ size
  4. Immediately delete the file when it says ‘Uploading attachment’ and wait for a moment.
  5. First bug : You’ll see that the even if the file has already been deleted , a blank image file is displayed on the chat for some time. Additionally, ‘Attachment’ is displayed on the right side chat menu.
  6. Second bug: Next, repeat the same steps and now react with any emoji in the empty image file. Notice that the image file goes away but the ‘Attachment’ is still displayed on the right hand side chat menu for some time.

Expected Result:

Deleting an image file that hasn't yet uploaded should not display an empty image file on the chat and should not display ‘Attachment’ on the chat menu

Actual Result:

Deleting an image file displays an empty image file on the chat and displays ‘Attachment’ on the chat menu.

Workaround:

unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.2.82-3
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos:

Recording.1674.mp4
image-2023-03-10_10.35.33.mp4

Expensify/Expensify Issue URL:
Issue reported by: @avi-shek-jha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1678424033842019

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014d0fc7ae438c05c4
  • Upwork Job ID: 1636152686846541824
  • Last Price Increase: 2023-04-05
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 10, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Mar 10, 2023
@MelvinBot
Copy link

Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

MelvinBot commented Mar 10, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@MelvinBot
Copy link

Triggered auto assignment to @deetergp (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@sonialiap
Copy link
Contributor

I was able to reproduce it. Started the upload, deleted. The blank box popped up in chat and "[Attachment]" in LHB. Seconds later both disappeared and the chat moved down to where it was before I attempted to send the message. Same behavior if I reacji to the blank box, the blank box disappears and the "[Attachment]" also disappears within a few seconds.

Looks like it's some kind of delay

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 13, 2023
@deetergp
Copy link
Contributor

deetergp commented Mar 15, 2023

@kavimuru Just to confirm, this only happens in web? Regardless, I'm sure it's can be dealt with in the front end by a contributor. Setting as External.

@melvin-bot melvin-bot bot removed the Overdue label Mar 15, 2023
@deetergp deetergp removed their assignment Mar 15, 2023
@deetergp deetergp added the External Added to denote the issue can be worked on by a contributor label Mar 15, 2023
@melvin-bot melvin-bot bot unlocked this conversation Mar 15, 2023
@melvin-bot melvin-bot bot changed the title Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction [$1000] Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction Mar 15, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 15, 2023
@MelvinBot
Copy link

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

@sonialiap
Copy link
Contributor

Just FYI, I'll be OOO Mar 17-25

@usenbekov
Copy link

usenbekov commented Mar 17, 2023

Proposal

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

Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction

What is the root cause of that problem?

SequentialQueue processes finalization order is LIFO, but the order-sensitive operations that should be executed after every SequentialQueue process (like Onyx.update) should be FIFO order.

Details:
User.js -> PusherUtils.subscribeToPrivateUserChannelEvent(ONYX_API_UPDATE) -> SequentialQueue.getCurrentRequest().then -> Onyx.update(pushJSON)

Here Onyx.update(pushJSON) will be called when the SequentialQueue current request is finished. But when we delete the attachment which is still uploading the Onyx.update(AddAttachment) won't be called until the delete process is finished, so it will be called last.

The visualization looks like this:

(AddAttachment)  process start {
    (DeleteComment) process start {
        ...next process in the SequentialQueue
    } then {
        Onyx.update(DeleteComment)
    }
} then {
    Onyx.update(AddAttachment)
}

So the Onyx.update(AddAttachment) will be called only after the next processes are finished, including the DeleteComment process.

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

We can keep another list of promises and for SequentialQueue.getCurrentRequest() we can return the last promise from this list. And on SequentialQueue -> on process finalization we can resolve these promises in the correct order.

The result is:

Screen.Recording.2023-03-30.at.11.36.27.AM.mp4

What alternative solutions did you explore? (Optional)

Another solution would be:
At User.js -> subscribeToUserEvents -> PusherUtils.subscribeToPrivateUserChannelEvent
we can wait for the SequentialQueue finalization and execute all pushJSON objects in the correct order.

@melvin-bot melvin-bot bot added the Overdue label Mar 20, 2023
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot changed the title [$1000] Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction [$2000] Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction Mar 22, 2023
@thesahindia
Copy link
Member

If I am not wrong we have plans to remove "uploading attachment" text, so I think we should do nothing here.

@melvin-bot melvin-bot bot added the Overdue label Mar 23, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Mar 23, 2023

If I am not wrong we have plans to remove "uploading attachment" text, so I think we should do nothing here.

@stitesExpensify can you please confirm this?

@melvin-bot melvin-bot bot removed the Overdue label Mar 23, 2023
@MelvinBot
Copy link

@sonialiap @stitesExpensify @0xmiroslav 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!

@melvin-bot melvin-bot bot added the Overdue label Mar 27, 2023
@stitesExpensify
Copy link
Contributor

If I am not wrong we have plans to remove "uploading attachment" text, so I think we should do nothing here.

@stitesExpensify can you please confirm this?

This is the first I've heard of this, but it's definitely possible. @thesahindia do you have the context for your comment?

@melvin-bot melvin-bot bot removed the Overdue label Mar 27, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction [$4000] Deleting an image file which is still uploading displays empty image file and disappears after adding a reaction Mar 29, 2023
@melvin-bot melvin-bot bot added the Overdue label Mar 29, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Mar 29, 2023

I think we should not allow deleting/any action while the attachment is uploading. Same I have proposed here and for inspiration, we can consider a similar pattern in the slack.

@thesahindia
Copy link
Member

Here's the thread for more info.

@usenbekov
Copy link

Proposal

Updated

@MelvinBot
Copy link

@sonialiap @stitesExpensify @0xmiroslav this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@MelvinBot
Copy link

@sonialiap, @stitesExpensify, @0xmiroslav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@hoangzinh
Copy link
Contributor

Are we going to close this GH issue or open for proposals?

@0xmiros
Copy link
Contributor

0xmiros commented Mar 31, 2023

Are we going to close this GH issue or open for proposals?

The discussion was 6 months ago but it seems no progress yet as low priority.
So I am not sure if we should "close this" or this is "worth fixing and go ahead".
@stitesExpensify will decide.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 31, 2023
@MelvinBot
Copy link

@sonialiap, @stitesExpensify, @0xmiroslav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@thesahindia
Copy link
Member

I believe we should just close this issue because we have plans to remove "uploading attachment" text (Previous discussion thread)

@sonialiap
Copy link
Contributor

@stitesExpensify what do you think of closing this one in favor of #9402?

@melvin-bot melvin-bot bot removed the Overdue label Apr 5, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Apr 5, 2023

This will be the expected result:

The image should be grayed (opacity 0.6 i.e., chatItemUnsentMessage) until its uploaded and once its uploaded it should not show the white thumbnail with loader
and instead continue showing the local thumbnail or show the final image immediately.

So uploading text will be replaced with grayed image or local thumbnail and it will still be reactionable.
So it makes sense to hold this issue and revisit after that PR merged.

@MelvinBot
Copy link

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

@stitesExpensify
Copy link
Contributor

I think that closing it makes sense @sonialiap. If we're getting rid of this functionality, we don't really need to fix it.

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 Engineering 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
None yet
Development

No branches or pull requests