-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: cache extra attributes for video markdown conversion #42463
Conversation
Note: This PR will needed to be reviewed and merged first: Expensify/expensify-common#703 |
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
I left a comment on Expensify/expensify-common#703 that @DylanDylann should review that one too since it's tightly coupled with this one. Please let me know if that isn't possible or is unreasonable. Thanks! |
@dominictb Please fill out the desktop video and resolve conflict + typescript error. Thanks |
@DylanDylann typescript issue is due to the |
@DylanDylann all good now (Desktop video added). You have to test along side with expensify-common change. The TS error will be automatically fixed once the lib PR is merged. |
@DylanDylann can you start reviewing? Thanks! |
Whoops, I am reviewing. It could take me a couple of days to review this PR |
const videoAttributesCache: Record<string, string> = {}; | ||
const originalMessage = parser.htmlToMarkdown(action.message?.[0]?.html ?? '', { | ||
cacheVideoAttributes: (videoSource, attrs) => { | ||
videoAttributesCache[videoSource] = attrs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dominictb Hi, Why don't we directly set attrs
to draftMessageVideoAttributeCache
? With this, we can move the clear
function to above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your quick update. Everything else looks good. Testing now
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-06-19.at.12.01.33.movAndroid: mWeb ChromeScreen.Recording.2024-06-19.at.11.47.55.moviOS: NativeScreen.Recording.2024-06-19.at.11.55.29.moviOS: mWeb SafariScreen.Recording.2024-06-19.at.11.47.11.movMacOS: Chrome / SafariScreen.Recording.2024-06-19.at.11.36.26.movMacOS: DesktopScreen.Recording.2024-06-19.at.11.42.21.mov |
@dominictb whoops, we have a minor lint error. Let's address it, too |
@tgolen @dominictb I wonder if the user tries to edit the video source. What should happen? Currently, if users try to edit the video source, the App displays the infinity load, they still can download this video but can't open Screen.Recording.2024-06-13.at.19.13.55.mov |
I think we should just do whatever GitHub does (which I assume is just allowing people to break it). |
I see that GH only converts to video tag if the source is valid. If users try to break the source by editing it, GH will not convert the markdown to video tag. It maybe require support from BE to validate the video source. @dominictb Do you have any suggestions for this? |
I would suggest @tgolen to bring this to the internal team for issue triage. |
OK, I can bring this up internally to get some thoughts on it, but let's not let that hold up this PR. I think we can handle what to do about broken video links in a separate issue. |
I brought this up in Slack (but it's an internal channel, so you won't have access). I'm just keeping a paper-trail going. |
@DylanDylann @tgolen this is ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up from the previous discussion about what to do if users break the URLs, we've agreed internally to ignore that edge case for now and if a user breaks a URL, it's on them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/tgolen in version: 1.4.86-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/tgolen in version: 1.4.86-0 🚀
|
🚀 Deployed to staging by https://github.com/tgolen in version: 1.4.86-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.0-9 🚀
|
Details
Fixed Issues
$ #41952
PROPOSAL: #41952 (comment)
Tests
To test, please use this branch of
expensify-common
: Expensify/expensify-common#703Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android1.mp4
Android: mWeb Chrome
android.mp4
iOS: Native
Uploading ios8.mp4…
iOS: mWeb Safari
iosweb.mp4
MacOS: Chrome / Safari
web8.mp4
MacOS: Desktop
Screen.Recording.2024-06-12.at.00.07.27.mov