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 2023-05-23] [$1000] Chat- Files mp4 with long name extend to the far edges of the screen. #16970

Closed
4 of 6 tasks
kbecciv opened this issue Apr 5, 2023 · 42 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Apr 5, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Login
  3. Navigate to a conversation
  4. Tap the grey plus button in compose box
  5. Tap on add attachment
  6. Mobile - Tap on choose from gallery
  7. Select a mp4 file with long name

Expected Result:

Attachment preview doesn't extend to the far edges of the screen.

Actual Result:

Files mp4 with long name extend to the far edges of the screen.

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.95.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:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Bug6007064_Screen_Recording_20230405_183417_Chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fea9233c3c7ebaef
  • Upwork Job ID: 1653854126087110656
  • Last Price Increase: 2023-05-12
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 5, 2023
@MelvinBot
Copy link

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

@MelvinBot

This comment was marked as resolved.

@melvin-bot melvin-bot bot added the Overdue label Apr 10, 2023
@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@PrashantMangukiya
Copy link
Contributor

Proposal

Posting proposal early as per new guidelines

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

Chat- Files mp4 with long name extend to the far edges of the screen.

What is the root cause of that problem?

AttachmentView is render via this at line 280, Parent View has styles.imageModalImageCenterContainer applied at 271

<View style={styles.imageModalImageCenterContainer}>
{this.props.reportID ? (
<AttachmentCarousel
reportID={this.props.reportID}
onNavigate={this.onNavigate}
source={this.props.source}
onToggleKeyboard={this.updateConfirmButtonVisibility}
/>
) : this.state.source && this.state.shouldLoadAttachment && (
<AttachmentView
source={source}
isAuthTokenRequired={this.props.isAuthTokenRequired}
file={this.state.file}
onToggleKeyboard={this.updateConfirmButtonVisibility}
/>
)}
</View>

imageModalImageCenterContainer uses width: '100%', so content within it will expand fully.

App/src/styles/styles.js

Lines 1916 to 1921 in 83b20de

imageModalImageCenterContainer: {
alignItems: 'center',
flex: 1,
justifyContent: 'center',
width: '100%',
},

Attachment view render via this code for mp4 or other attachment. So content within it will expand fully this is the root cause of the problem.

return (
<View
style={styles.defaultAttachmentView}
>

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

From AttachmentModal.js we have to pass containerStyles props to <AttachmentView> as shown below:

  <AttachmentView
      containerStyles={[styles.mh5]}     //  *** Add this
      source={source}
      isAuthTokenRequired={this.props.isAuthTokenRequired}
      file={this.state.file}
      onToggleKeyboard={this.updateConfirmButtonVisibility}
  />

We have to use containerStyles props in AttachmentView view as shown code below:

return ( 
  <View 
   style={[styles.defaultAttachmentView, ...props.containerStyles]}
  > 
     ....
  </View>
);

Important: AttachmentView is used multiple places like chat listing and attachment modal. This is the reason why we added containerStyles prop.

So while we render it within attachment modal we can set horizontal margin and during chat list it will behave normally.

This will solve the problem and shows horizontal margin when needed as shown in result video.

What alternative solutions did you explore? (Optional)

None

Results
Attachment.mov

@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 19, 2023
@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@MelvinBot

This comment was marked as resolved.

@melvin-bot melvin-bot bot added the Internal Requires API changes or must be handled by Expensify staff label May 3, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Triggered auto assignment to Contributor Plus for review of internal employee PR - @rushatgabhane (Internal)

@rushatgabhane
Copy link
Member

rushatgabhane commented May 5, 2023

I got assigned 2 days ago. I think we missed adding Engineering label here?

@melvin-bot melvin-bot bot removed the Overdue label May 5, 2023
@rushatgabhane
Copy link
Member

rushatgabhane commented May 5, 2023

@PrashantMangukiya horiziontal margin of 20 seems good to me.

C+ reveiwed 🎀 👀 🎀

image

@melvin-bot melvin-bot bot added the Overdue label May 8, 2023
@melvin-bot

This comment was marked as resolved.

@rushatgabhane
Copy link
Member

We need to add engineering label and hire @PrashantMangukiya to fix this issue

@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

📣 @PrashantMangukiya You have been assigned to this job by @greg-schroeder!
Please apply to this job in Upwork 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 📖

@greg-schroeder
Copy link
Contributor

Okay - set to External and assigned you @PrashantMangukiya

@PrashantMangukiya
Copy link
Contributor

@greg-schroeder @rushatgabhane Thanks. I will prepare and submit pr within 2 hours asap.

@PrashantMangukiya
Copy link
Contributor

@rushatgabhane @danieldoglas @greg-schroeder PR is ready for review.

@danieldoglas danieldoglas self-assigned this May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

🎯 ⚡️ Woah @rushatgabhane / @PrashantMangukiya, great job pushing this forwards! ⚡️

The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @PrashantMangukiya got assigned: 2023-05-12 06:57:36 Z
  • when the PR got merged: 2023-05-15 12:26:37 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat- Files mp4 with long name extend to the far edges of the screen. [HOLD for payment 2023-05-23] [$1000] Chat- Files mp4 with long name extend to the far edges of the screen. May 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.14-14 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 2023-05-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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:

  • [@rushatgabhane] The PR that introduced the bug has been identified. Link to the PR:
  • [@rushatgabhane] 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:
  • [@rushatgabhane] 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:
  • [@rushatgabhane] Determine if we should create a regression test for this bug.
  • [@rushatgabhane] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@greg-schroeder
Copy link
Contributor

Offers sent to @rushatgabhane @PrashantMangukiya in preparation for payment date tomorrow, 5/23

@danieldoglas
Copy link
Contributor

@rushatgabhane please fill the checklist above

@greg-schroeder
Copy link
Contributor

Bump @rushatgabhane for the checklist and also to accept the offer for payment :)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 23, 2023
@greg-schroeder
Copy link
Contributor

Friendly bump on the checklist and payment offer @rushatgabhane

@greg-schroeder
Copy link
Contributor

Pinged in the c+ room!

@melvin-bot melvin-bot bot added the Overdue label May 29, 2023
@danieldoglas
Copy link
Contributor

Pinged in the c+ room again

@melvin-bot melvin-bot bot removed the Overdue label May 29, 2023
@greg-schroeder
Copy link
Contributor

Updated the offer to @rushatgabhane's new Upwork profile, just waiting on the checklist

@rushatgabhane
Copy link
Member

rushatgabhane commented May 30, 2023

This bug was present since Dec 2020 (source). I don't think there's much value in doing the checklist

image
  1. The PR that introduced the bug has been identified. Link to the PR: Add Modal Previews when Uploading Attachments + Copy/Paste files #685

  2. 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:

  3. 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: N.A.

  4. Determine if we should create a regression test for this bug. Not required.

  5. 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 - N.A.

@greg-schroeder
Copy link
Contributor

Thanks @rushatgabhane

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants