Closed lanitochka17 closed 12 months ago
Triggered auto assignment to @Christinadobrzyn (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)I can't reproduce this going to reach back out to QA to see if they can confirm it's still happening and update the steps to reproduce.
Reaching out to QA https://expensify.slack.com/archives/C9YU7BX5M/p1694794909719529
Issue reproducible on Build 1.3.70-5 SG A50/Android11 Messages were sent one after another
https://github.com/Expensify/App/assets/78819774/dd41cfd0-e78d-4391-ad7e-3978d817ffe7
I can reproduce this... but it's not super consistent. Because of the inconsistency, I wonder if we should not fix this now and see if something else resolves it.
Using V1.3.71-2 on the Android app app Samsung Galaxy S22 Using v1.3.7 0-8 on web app Samsung
https://github.com/Expensify/App/assets/51066321/2c29f26a-e0ed-4807-bfeb-ded6117bcbbf
Job added to Upwork: https://www.upwork.com/jobs/~018a50aa27edf905a3
Triggered auto assignment to Contributor Plus for review of internal employee PR - @mananjadhav (Internal
)
hey @mananjadhav can you give me your thoughts on https://github.com/Expensify/App/issues/27456#issuecomment-1724503801
nudge @mananjadhav on https://github.com/Expensify/App/issues/27456#issuecomment-1724503801
I tried a few times, but I couldn't. I checked on the emulator. Does it require a physical device to check?
I was using the Chrome Website on a physical Android device (User B) and messaging the Android app through Browserstack (User A).
It's not super consistent which is always tough to troubleshoot so I don't know if we should just close this and expect it will clear up with other issues.
@mananjadhav @Christinadobrzyn this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
I updated the OP to see if that helps @mananjadhav - can you try again to reproduce and let me know what you think is best next steps here... maybe we should close since it's difficult to reproduce.
@mananjadhav, @Christinadobrzyn Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@Christinadobrzyn I think you can reassign this one. I haven't been able to spend as much time as this requires.
Triggered auto assignment to Contributor Plus for review of internal employee PR - @Santhosh-Sellavel (Internal
)
Hey @Santhosh-Sellavel! Catching you up here, we're still reproducing this and seeing if it's necessary for a fix based on this comment. Let me know what you think!
Yeah this is something we should fix, if its reproducible.
Thanks @Santhosh-Sellavel can this be external?
Yes, it can be external.
Current assignee @Santhosh-Sellavel is eligible for the External assigner, not assigning anyone new.
@Christinadobrzyn @Santhosh-Sellavel 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!
Gonna increase the price to see if that helps with proposals.
Upwork job price has been updated to $1000
still waiting on proposals. Do you think this would be something that would fit one of our contractors @Santhosh-Sellavel? I can reach out to SWM to see if they have the bandwidth.
That's good idea, but lets wait for few days or a week. If no takers by then let's get help from SWM or Callstack!
@Christinadobrzyn, @Santhosh-Sellavel Whoops! This issue is 2 days overdue. Let's get this updated quick!
I am Roksana from Callstack - expert contributor group. I’d like to work on this job.
📣 @roksanaz! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
I am Roksana from Callstack - expert contributor group. I’d like to work on this job.
Can you submit a formal proposal please, thanks!
📣 @Santhosh-Sellavel Please request via NewDot manual requests for the Reviewer role ($1000)
The BZ member will need to manually hire roksanaz for the Contributor role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!
Assigning @roksanaz But still please post a proposal here to discuss before raising a PR thanks!
I'm working on a proposal (should be ready tomorrow), but just to be sure: the desirable behavior is that when the user is active in chat screen, there shouldn't be a green line for new messages, am I correct? (citing the expected result: "As user A is already in conversation page, the green line must not be shown when messages received from user B")
Let's consider a scenario to understand the expected outcome.
There a two User A & User B. Following or the sequence of actions
User A
is chatting with someone else and new messages are received from User B
, thus making User B
in Sidebar LHN bold.User A
navigates to User B's
chat.
Expected Behaviour is a Line indicator that should be shown above the first unread message.User A
is active on User B's chat and scrolling the old chat, now new messages are received. Now the expected behavior is when the user scrolls to the new message manually or by using the new messages badge, should see an indicator above the first unread item.User A
is active on User B's chat but viewing the latest, now new messages are received.
I'm not sure, but I guess there should not be any indicator new messages should be shown right away.@Christinadobrzyn/@mountiny Can you loop someone from the product team to confirm the expected behavior, correct me if wrong on the above. thanks!
@roksanaz @Christinadobrzyn @Santhosh-Sellavel this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @Santhosh-Sellavel is eligible for the Internal assigner, not assigning anyone new.
I'm sorry for taking so much time. We had a discussion that maybe another PR concerning unread messages might resolve this issue, but unfortunately that's not the case :( I need to consult 1 thing and my proposal should be ready after that.
I think this is correct but gonna ask Vit if they can double-check- https://github.com/Expensify/App/issues/27456#issuecomment-1758212639
Sounds like this job was discussed between @MonilBhavsar and @roksanaz - https://expensify.slack.com/archives/C03UK30EA1Z/p1697013288899459
so I think they should be able to answer your questions @Santhosh-Sellavel once they get things narrowed down?
@Santhosh-Sellavel and @Christinadobrzyn yes, we discussed the logic from this comment and points 1-4 are tested and working in this PR, point 5 will be implemented within this issue.
I'm on the right track with my proposal, should be ready on Monday.
If the user A is already active in the chat thread with the user B, the user A receives a new message from the user B, a green line appears above the new message. If more messages come (especially at the same time) the green line appears erratically. The expected behaviour is that no green line appears for new messages if the thread is scrolled to the latest message.
I could reproduce this behaviour for all platforms. The problem isn’t specific only for Android.
The root cause for the problem is that we don’t take into account the position of the user (the vertical offset) in the conditions for the flag called shouldDisplayNewMarker
, which if it’s true - the green line appears.
Currently on the first render of the message shouldDisplayNewMarker
is true if the flag lastReadTime
sent by the server is smaller than the message’s created time (and it is always true for new messages):
Then, the application sends information to the server that the message is read, the message is re-rendered, shouldDisplayNewMarker
is false and the green line disappears.
As the desired behaviour is not to display the green line for any new messages provided that the thread is scrolled to the latest message, we should take into account the vertical offset of the user as it’s the case with the floating button. shouldDisplayNewMarker
should be false for threads at the end of the threshold before sending the information to the server to avoid green line appearing (or flickering). If the thread is scrolled up to older messages, then the floating button should appear and after scrolling down to the newest messages, the green line should appear above the new message.
There is already a variable in the code called canDisplayMarker
, which holds the information about the user’s position and if the user is active:
But now it’s introduced after shouldDisplayNewMarker
is already true and taken into account only to decide which message should be marked as new. So my solution is to introduce canDisplayMarker
earlier and check it while deciding for the first time if shouldDisplayNewMarker
should be true, like so:
shouldDisplayNewMarker = isCurrentMessageUnread && !isMessageUnread(nextMessage, report.lastReadTime) && canDisplayMarker;
Looks good, let's hold for the other PR to get merged.
I think we can move forward here since it doesn't overlap with the other PR. @roksanaz do you think we can get rid of canDisplayMarker
completely and have only one variable shouldDisplayMarker
. We previously thought of doing this, but didn't, but figured it was something we could do. I think this is good opportunity to get rid of two similar variables. Also cc @gedu for thoughts on the above proposal
@MonilBhavsar We could get rid of this variable, but then shouldDisplayMarker
would consist of an unnamed condition instead of canDisplayMarker
, like so:
shouldDisplayNewMarker = isCurrentMessageUnread &&
!isMessageUnread(nextMessage, report.lastReadTime) &&
scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created < userActiveSince.current : true;
If I were to do a complete refactor of this part, I would make it more readable, so instead of this:
I would write it like that:
const nextMessage = sortedReportActions[index + 1];
const isCurrentMessageUnread = isMessageUnread(reportAction, report.lastReadTime);
const isNextMessageRead = !isMessageUnread(nextMessage, report.lastReadTime);
const isWithinVisibleThreshold = scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created <
userActiveSince.current : true;
shouldDisplayNewMarker = isCurrentMessageUnread && isNextMessageRead && isWithinVisibleThreshold;
if (shouldDisplayNewMarker && !messageManuallyMarkedUnread) {
shouldDisplayNewMarker = reportAction.actorAccountID !== Report.getCurrentUserAccountID();
}
if (shouldDisplayNewMarker) {
setCurrentUnreadMarker(reportAction.reportActionID);
}
Let me know which approach is best for you.
Looks like last condition is missing currentUnreadMarker
. But later one looks clean to me. Thanks!
if (!currentUnreadMarker && shouldDisplayNewMarker) {
setCurrentUnreadMarker(reportAction.reportActionID);
}
I think !currentUnreadMarker
condition was redundant in line 299, as all of this logic is wrapped in the same condition:
So I'll head in this direction with my PR, thank you.
Yes, you're right 👍 Thank you!
Current assignee @Santhosh-Sellavel is eligible for the External assigner, not assigning anyone new.
Looks like draft PR is up and in being pre-reviewed
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:
Expected Result:
As user A is already in conversation page, the green line must not be shown when messages received from user B
Actual Result:
The green line is displayed chaotically at the recipient
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.70-2
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
https://github.com/Expensify/App/assets/78819774/1af8a7f0-1afc-4101-bb8f-26f3fd523695
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit