-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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] Room - Endless Loading of Header When Navigating to Thread of Mentioned Room #40928
Comments
Triggered auto assignment to @isabelastisser ( |
We think that this bug might be related to #vip-vsb |
@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors. |
Job added to Upwork: https://www.upwork.com/jobs/~0137b18b289d467863 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Room - Endless Loading of Header When Navigating to Thread of Mentioned Room What is the root cause of that problem?Here we set What changes do you think we should make in order to solve the problem?Update this line like below. It is not specified exactly what should be displayed, so I suggested еру
What alternative solutions did you explore? (Optional) |
@shahinyan11 I think the expected result should show the message in the header, but with your solution, it will show
Your root cause might not be correct, the issue is only reproduced if the message just contains the mention tag. Screen.Recording.2024-04-29.at.12.24.51.mp4 |
@mollfpr, any updates? Are we still waiting for proposals? |
@isabelastisser Still waiting for @shahinyan11 and other proposals. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Header of thread report displayed as skeleton view if the parent report action message is report mention. What is the root cause of that problem?In HeaderView the skeleton view will be displayed if isLoading: App/src/pages/home/HeaderView.tsx Line 220 in 035adb8
is true. It's value will be true in this issue because title variable What changes do you think we should make in order to solve the problem?In this line: Line 2949 in 035adb8
We could use reportAction?.message?.[0]?.html and detect all occurrence of pattern The code could be: Code:function embedMentionedReportName(reportAction){
const {html, text} = reportAction?.message?.[0];
if (!html) {
return text;
}
const mentionReportRegex = /(\<mention-report reportID\=\"(\d+)\"\/>)/gm;
if (!mentionReportRegex.test(html)) {
return text;
}
const splittedText = text.split(" ");
// Remove tags except for mention-report
const filteredHtml = html.replace(/(\<(?!mention-report).*?\>)/gm, "");
// Embed report name into html enclosed by tag, for exampple: <#announce>
const htmlWithReportName = filteredHtml.replace(/(\<mention-report reportID\=\"(\d+?)\"\/\>)/gm,
(match, p1, p2) => `<${getReportName(getReport(p2))}>`
);
const splittedHtmlWithReportName = htmlWithReportName.split(" ");
const taggedReportNameRegex = /\<(.+)\>/gm;
splittedHtmlWithReportName.forEach((str, index) => {
const match = taggedReportNameRegex.exec(str ?? "");
if (match) {
const cSpliitedText = splittedText[index] ?? "";
splittedText[index] = match.index > 0 ? cSpliitedText + match[1] : match[1] + cSpliitedText;
}
taggedReportNameRegex.lastIndex = 0;
})
return splittedText.join(" ");
} Then in here: Line 2949 in 035adb8
call it with: const embeddedMentionedReportName = embedMentionedReportName(reportAction);
return Str.removeSMSDomain( embeddedMentionedReportName ?? ''); What alternative solutions did you explore?We could use ExpensiMark htmlToText to parse the html string. |
@mollfpr can you please review the proposal above? Thanks! |
@tsa321 I'm incline with your approach, could you share the result of your proposal? |
Issue not reproducible during KI retests. (First week) |
The code could be: Code:function embedMentionedReportName(reportAction){
const {html, text} = reportAction?.message?.[0];
if (!html) {
return text;
}
const mentionReportRegex = /(\<mention-report reportID\=\"(\d+)\"\/>)/gm;
if (!mentionReportRegex.test(html)) {
return text;
}
const splittedText = text.split(" ");
// Remove tags except for mention-report
const filteredHtml = html.replace(/(\<(?!mention-report).*?\>)/gm, "");
// Embed report name into html enclosed by tag, for exampple: <#announce>
const htmlWithReportName = filteredHtml.replace(/(\<mention-report reportID\=\"(\d+?)\"\/\>)/gm,
(match, p1, p2) => `<${getReportName(getReport(p2))}>`
);
const splittedHtmlWithReportName = htmlWithReportName.split(" ");
const taggedReportNameRegex = /\<(.+)\>/gm;
splittedHtmlWithReportName.forEach((str, index) => {
const match = taggedReportNameRegex.exec(str ?? "");
if (match) {
const cSpliitedText = splittedText[index] ?? "";
splittedText[index] = match.index > 0 ? cSpliitedText + match[1] : match[1] + cSpliitedText;
}
taggedReportNameRegex.lastIndex = 0;
})
return splittedText.join(" ");
} Then in here: Line 2949 in 035adb8
call it with: const embeddedMentionedReportName = embedMentionedReportName(reportAction);
return Str.removeSMSDomain( embeddedMentionedReportName ?? ''); Result:macos-web-d.mp4 |
@mollfpr @isabelastisser 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! |
not overdue. |
Almost looks good! Just one issue if we send the message a report mentions and a text, it removes the space between them. Screen.Recording.2024-05-13.at.22.03.07.mp4 |
@mollfpr I cannot reproduce this bug in staging, maybe already fixed from BE ? |
I still able reproduce the issue in dev and staging. The key is we should wait until the API is send. Screen.Recording.2024-05-14.at.01.48.52.mp4 |
@mollfpr you are right Here is revised version of the function: code:function embedMentionedReportName(reportAction){
const {html, text} = reportAction?.message?.[0];
if (!html) {
return text;
}
const mentionReportRegex = /(\<mention-report reportID\=\"(\d+)\"\/>)/gm;
if (!mentionReportRegex.test(html)) {
return text;
}
let splittedText = text.split(" ");
// Remove tags except for mention-report
const filteredHtml = html.replace(/(\<(?!mention-report).*?\>)/gm, "");
// Embed report name into html enclosed by tag, for exampple: <#announce>
const htmlWithReportName = filteredHtml.replace(/(\<mention-report reportID\=\"(\d+?)\"\/\>)/gm,
(match, p1, p2) => `<${getReportName(getReport(p2))}>`
);
const splittedHtmlWithReportName = htmlWithReportName.split(" ");
const numberOfMentionedRoomInFront = splittedHtmlWithReportName.findIndex((item) => item[0] !== '<' && item[1] !=='>');
if (numberOfMentionedRoomInFront > 0) {
splittedText = Array(numberOfMentionedRoomInFront).fill("").concat(splittedText);
}
const taggedReportNameRegex = /\<(.+)\>/gm;
splittedHtmlWithReportName.forEach((str, index) => {
const match = taggedReportNameRegex.exec(str ?? "");
if (match) {
const cSpliitedText = splittedText[index] ?? "";
splittedText[index] = match.index > 0 ? cSpliitedText + match[1] : match[1] + cSpliitedText;
}
taggedReportNameRegex.lastIndex = 0;
})
return splittedText.join(" ");
}
|
Thanks for the update @tsa321! I'll try the update when the BE issue is resolved. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Hi @mollfpr, what are the next steps here? |
Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @tsa321 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Issue not reproducible during KI retests. (Second week) |
Thank you, maybe I will submit a PR in one or two days. |
@luacmartins @mollfpr @isabelastisser @tsa321 this issue is now 4 weeks old, please consider:
Thanks! |
It looks like the PR was submitted here: #42504 |
#40928 (comment) I could still reproduce the issue just now. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v1.4.65-0
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: Applause - Internal Testing
Action Performed:
Expected Result:
Upon entering the thread, the header enters an infinite loading state.
Actual Result:
The mentioned room should be displayed in the header as expected, without any endless loading.
Workaround:
n/a
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6460103_1713955694030.Screen_Recording_2024-04-24_at_3.45.34_AM.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: