Skip to content

[HOLD for payment 2023-10-13] [$500] mWeb-Conversation-User A in offline typing message, User B is shown "user A is typing" #28063

Closed

Description

@izarutskaya

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. As user A, tap profile- Preferences
  3. Toggle on forced offline
  4. Open 1:1 with user B
  5. In other device, as user B, open 1:1 with user A
  6. As user A, in offline type messages to user B and note user B conversation page

Expected Result:

User A in offline typing message, User B must not be shown "user A is typing" in conversation page.

Actual Result:

User A in offline typing message, User B is shown "user A is typing" in conversation page.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.3.73-0

Reproducible in staging?: Y

Reproducible in production?: No "Force offline" mode

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

Bug6211463_2user_shown_user_a_typing.mp4
Bug6211463_offline_android_user_a_typing_shown_to_userb.mp4
Bug6211463_1offline_mweb.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/~01650cee09674fc251
  • Upwork Job ID: 1707005436379205632
  • Last Price Increase: 2023-09-27

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Sep 23, 2023
  2. melvin-bot commented on Sep 23, 2023

    @melvin-bot

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

  3. melvin-bot commented on Sep 23, 2023

    @melvin-bot

    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
  4. OSBotify commented on Sep 23, 2023

    @OSBotify
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. melvin-bot commented on Sep 23, 2023

    @melvin-bot

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

  6. akinwale commented on Sep 23, 2023

    @akinwale
    Contributor

    Proposal

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

    The "user is typing" event is broadcasted by a user's client even if the client has force offline mode enabled.

    What is the root cause of that problem?

    Pusher sends socket events even if force offline mode is enabled.

    function sendEvent(channelName, eventName, payload) {
    // Check to see if we are subscribed to this channel before sending the event. Sending client events over channels
    // we are not subscribed too will throw errors and cause reconnection attempts. Subscriptions are not instant and
    // can happen later than we expect.
    if (!isSubscribed(channelName)) {
    return;
    }
    socket.send_event(eventName, payload, channelName);
    }

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

    Solution 1
    Similar to what we have in the bindEventToChannel method, modify the sendEvent method to perform an early return if shouldForceOffline is true.

    function sendEvent(channelName, eventName, payload) {
        // Check to see if we are subscribed to this channel before sending the event. Sending client events over channels
        // we are not subscribed too will throw errors and cause reconnection attempts. Subscriptions are not instant and
        // can happen later than we expect.
        if (!isSubscribed(channelName)) {
            return;
        }
    
    +    if (shouldForceOffline) {
    +        Log.info('[Pusher] Ignoring a send event because shouldForceOffline = true');
    +        return;
    +    }
    
       // ... rest of the method
    }

    Solution 2
    In ReportActionsView, add a useEffect hook to unsubscribe to the pusher channel based on the network.isOffline prop. This, however does not cover all possible pusher events, so Solution 1 is preferable.

    const subscribeToReportTypingEvents = () => {
        const didCreateReportSuccessfully = !props.report.pendingFields || (!props.report.pendingFields.addWorkspaceRoom && !props.report.pendingFields.createChat);
        if (!didSubscribeToReportTypingEvents.current && didCreateReportSuccessfully) {
            Report.subscribeToReportTypingEvents(reportID);
            didSubscribeToReportTypingEvents.current = true;
        }
    }
    
    useEffect(() => {
        if (network.isOffline) {
            Report.unsubscribeFromReportChannel(reportID);
            didSubscribeToReportTypingEvents.current = true;
            return;
        }
        
        subscribeToReportTypingEvents();
    }, [network.isOffline, reportID]);
    

    What alternative solutions did you explore? (Optional)

    None.

  7. joelbettner commented on Sep 25, 2023

    @joelbettner

    I don't think this is an hourly, since I believe this will only ever happen on staging (I THINK we always hide the TestToolMenu in production...I could be wrong). I don't think this was caused by the recent deploy. I think this has been happening ever since we introduced the Force Offline mode. @izarutskaya is this something that you just came across, or is this test something that happens at every deploy?

    @neil-marcellini @roryabraham it looks like you are the two fellas who have the most background in the Force Offline mode. Care to weigh in here?

  8. removed
    DeployBlockerCash
    on Sep 25, 2023
  9. 36 remaining items

  10. removed
    Reviewing
    on Oct 6, 2023
  11. melvin-bot commented on Oct 6, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.78-4 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-10-13. 🎊

    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

    For reference, here are some details about the assignees on this issue:

    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
  12. melvin-bot commented on Oct 6, 2023

    @melvin-bot

    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:

    • [@akinwale / @ntdiary] The PR that introduced the bug has been identified. Link to the PR:
    • [@akinwale / @ntdiary] 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:
    • [@akinwale / @ntdiary] 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:
    • [@akinwale / @ntdiary] Determine if we should create a regression test for this bug.
    • [@akinwale / @ntdiary] 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.
    • [@NicMendonca] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  13. added
    Daily
    and removed
    Weekly
    on Oct 12, 2023
  14. NicMendonca commented on Oct 13, 2023

    @NicMendonca
    Contributor

    @akinwale @ntdiary bump on BZ check list ^^

    Also can you both apply to the job please? https://www.upwork.com/jobs/~01650cee09674fc251

  15. akinwale commented on Oct 13, 2023

    @akinwale
    Contributor

    @akinwale @ntdiary bump on BZ check list ^^

    Also can you both apply to the job please? https://www.upwork.com/jobs/~01650cee09674fc251

    Applied. Thanks!

    I believe it's the C+ that's supposed to complete the BZ check list. Weird that my name is in there. 😅

  16. ntdiary commented on Oct 13, 2023

    @ntdiary
    Contributor

    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:

    I believe it's the C+ that's supposed to complete the BZ check list. Weird that my name is in there. 😅

    I guess it's because you are already in C+ as well. 😄

  17. NicMendonca commented on Oct 13, 2023

    @NicMendonca
    Contributor

    Payment summary:

    Reporter: N/A
    Contributor: @akinwale - $750 (paid via upwork)
    Contributor +: @ntdiary - $750 (paid via upwork)

  18. NicMendonca commented on Oct 13, 2023

    @NicMendonca
    Contributor

    Sent you both an offer!

  19. akinwale commented on Oct 13, 2023

    @akinwale
    Contributor

    Sent you both an offer!

    Accepted. Thanks!

  20. NicMendonca commented on Oct 16, 2023

    @NicMendonca
    Contributor

    both paid, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions