Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.59k stars 2.92k forks source link

[HOLD for payment 2023-11-30] Notification - User is navigated to LHN after opening notification when app is closed #31625

Closed lanitochka17 closed 11 months ago

lanitochka17 commented 1 year ago

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: 1.4.1.7 Reproducible in staging?: Y Reproducible in production?: N 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 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

  1. Kill the ND app
  2. Wait for about 1 minute
  3. Send a message from the secondary device to the user logged in on the main device
  4. After notification is received, wait 10 seconds and disable the internet
  5. Double-tap the notification

Expected Result:

User is navigated to the correct chat

Actual Result:

User is navigated to the LHN

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/a10060ce-ae9b-4f8b-94d1-9d68abbcf941

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @laurenreidexpensify
github-actions[bot] commented 1 year ago

:wave: 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.
melvin-bot[bot] commented 1 year ago

📣 @github-actions[bot]! 📣 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:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
melvin-bot[bot] commented 1 year ago

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

lanitochka17 commented 1 year ago

Production :

https://github.com/Expensify/App/assets/78819774/3af33eb7-91d4-4e0c-9960-79eaf8dc0835

pecanoro commented 1 year ago

I managed to reproduce on staging even when online

https://github.com/Expensify/App/assets/6474442/f100ed0e-2c3f-4b4a-b1be-b4036e2fe5fe

Julesssss commented 1 year ago

We drop the onyx data from the notification payload once it reaches 3.5kb. I wonder if recent additions to the onyx payloads have once again broken push notifications (cc@arosiclair)

johnmlee101 commented 1 year ago

cc @arosiclair

johnmlee101 commented 1 year ago

BTW https://www.expensify.com/_devportal/tools/logSearch/#sort=asc&size=5000&query=blob%3A%22Logging%20request%20details%22%20AND%20email%3A%22john%40expensify.com%22%20AND%20timestamp%3A%5B2023-11-21T00%3A00%20TO%202023-11-22T23%3A59%5D this seems to be 3k characters in the request, but not sure if thats going down the right path

johnmlee101 commented 1 year ago

Keeping some discussion here: https://expensify.slack.com/archives/C07J32337/p1700588638959299?thread_ts=1700588255.529729&cid=C07J32337

But this was logged in some of the requests

829a53ea89181879-EWR | staging-www1.sjc | 2023-11-21 16:32:26 933 | john@expensify.com | MobilePushNotifications - NewDot notification payload data exceeded the maximum allowable. Deleting onyxData field.
arosiclair commented 1 year ago

I can reproduce this in dev. It seems like there are no issues with handling the notification click:

DEBUG [info] Navigating to route - {"path":"/r/34"}

however it looks like there's code navigating back to the home page after we navigate to the chat which is breaking this functionality:

[info] Navigating to route - {"path":"/"}

Maybe one of this deploy's PRs added an extra navigation that's doing this?

DEBUG  Timing:development.new.expensify.trie_initialization 2390
 LOG  Running "NewExpensify" with {"rootTag":11}
 DEBUG  [OnyxUpdateManager] Listening for updates from the server
 DEBUG  [info] [PushNotification] Callback triggered for com.airship.push_received - ""
 DEBUG  [info] [PushNotification] received report comment notification in the foreground - {"reportID":34,"reportActionID":"3096043123628849351"}
 DEBUG  [info] [Onyx] merge() called for key: report_34 properties: reportID,reportName,type,chatType,ownerEmail,ownerAccountID,managerEmail,managerID,policyID,participantAccountIDs,visibleChatMemberList,isPinned,lastReadTime,lastReadSequenceNumber,lastVisibleActionCreated,lastVisibleActionLastModified,lastMessageText,lastActorAccountID,notificationPreference,welcomeMessage,stateNum,statusNum,oldPolicyName,isOwnPolicyExpenseChat,lastMessageHtml,iouReportID,hasOutstandingIOU,hasOutstandingChildRequest,writeCapability,total,currency,submitterPayPalMeAddress,isWaitingOnBankAccount,nonReimbursableTotal,maxSequenceNumber,hasDraft - ""
 DEBUG  [info] [Onyx] merge() called for key: reportActions_34 properties: 2279458499987116741,1810592943714682823,720260980807411269,5021502884569866715,3096043123628849351 - ""
 DEBUG  [info] [PushNotification] Subscribing to notifications - ""
 DEBUG  [info] Called API write - {"command":"OptInToPushNotifications","deviceID":"sunfish13b96e6e-7517-9667-9384-7d9653abb2b6"}
 DEBUG  [info] [Onyx] set() called for key: networkRequestQueue properties: 0,1,2,3,4 - ""
 DEBUG  [info] [Onyx] merge() called for key: pushNotificationsEnabled - ""
 DEBUG  [info] Found existing deviceID - "sunfish13b96e6e-7517-9667-9384-7d9653abb2b6"
 DEBUG  [info] Making API request - {"command":"ReconnectApp"}
 DEBUG  [info] [PushNotification] Callback triggered for com.airship.notification_response - ""
 DEBUG  [info] [PushNotification] onSelected() - called - {"reportID":34,"reportActionID":"3096043123628849351"}
 DEBUG  [info] [PushNotification] Callback triggered for com.airship.notification_response - ""
 DEBUG  [info] [PushNotification] onSelected() - called - {"reportID":34,"reportActionID":"3096043123628849351"}
 DEBUG  [info] [NetworkConnection] NetInfo state change - {"details":{"isConnectionExpensive":false,"txLinkSpeed":780,"rxLinkSpeed":866,"linkSpeed":780,"subnet":"255.255.255.0","ipAddress":"192.168.86.118","frequency":5180,"strength":99,"bssid":"02:00:00:00:00:00"},"isConnected":true,"type":"wifi","isInternetReachable":true,"isWifiEnabled":true}
 DEBUG  [info] [Migrate Onyx] start - ""
 DEBUG  [info] [Onyx] merge() called for key: network properties: isOffline - ""
 DEBUG  [info] [Onyx] set() called for key: demoInfo properties:  - ""
 DEBUG  [info] [Onyx] set() called for key: isCheckingPublicRoom - ""
 DEBUG  [info] [Migrate Onyx] Skipped migration RenameReceiptFilename because there are no transactions - ""
 DEBUG  [info] [Migrate Onyx] Skipped migration KeyReportActionsDraftByReportActionID because there were no reportActionsDrafts - ""
 DEBUG  [info] [Migrate Onyx] Skipped TransactionBackupsToCollection migration because there are no transactions - ""
 DEBUG  [info] [Migrate Onyx] finished in 47ms - ""
 DEBUG  [info] [NetworkConnection] listenForReconnect called - ""
 DEBUG  [info] [PushNotification] onSelected() - Navigation is ready. Navigating... - {"reportID":34,"reportActionID":"3096043123628849351"}
 DEBUG  [info] Navigating to route - {"path":"/?initial=true&screen=Report&params=%5Bobject%20Object%5D&path=%2Fr%2F34"}
 DEBUG  [info] Navigating to route - {"path":"/r/34"}
 DEBUG  [info] [PushNotification] onSelected() - Navigation is ready. Navigating... - {"reportID":34,"reportActionID":"3096043123628849351"}
 DEBUG  Timing:development.new.expensify.homepage_initial_render 641
 DEBUG  [info] Navigating to route - {"path":"/"}
 DEBUG  [info] Navigating to route - {"path":"/"}
 DEBUG  [hmmm] [PusherConnectionManager] state change - {"states":{"previous":"connecting","current":"connected"}}
 DEBUG  [hmmm] [PusherConnectionManager] connected event - ""
 DEBUG  [info] [Pusher] Attempting to subscribe to channel - {"channelName":"private-encrypted-user-accountID-2-f1f0504637ff4702af969520f3c069df","eventName":"multipleEvents"}
 DEBUG  [info] [PusherAuthorizer] Attempting to authorize Pusher - {"channelName":"private-encrypted-user-accountID-2-f1f0504637ff4702af969520f3c069df"}
 DEBUG  [info] Called API makeRequestWithSideEffects - {"command":"AuthenticatePusher","socket_id":"582391.201247","channel_name":"private-encrypted-user-accountID-2-f1f0504637ff4702af969520f3c069df","shouldRetry":false,"forceNetworkRequest":true}
 DEBUG  [info] Making API request - {"command":"AuthenticatePusher"}
luacmartins commented 1 year ago

Removing the blocker label since we CPed a fix.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.2-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-11-30. :confetti_ball:

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.

melvin-bot[bot] commented 12 months ago

@johnmlee101 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 12 months ago

@johnmlee101 Huh... This is 4 days overdue. Who can take care of this?

pecanoro commented 12 months ago

I think @arosiclair fixed this with the linked PR and we can close it, right? I assigned him to give him credit since he created the PR to fix it.

arosiclair commented 12 months ago

This should be all set so closing this out

aimane-chnaif commented 12 months ago

@arosiclair can you please reopen and add Bug label for C+ payment? Thanks

melvin-bot[bot] commented 12 months ago

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

melvin-bot[bot] commented 12 months ago

Bug0 Triage Checklist (Main S/O)

arosiclair commented 12 months ago

@laurenreidexpensify can you handle payment for @aimane-chnaif's C+ review? Thanks!

laurenreidexpensify commented 11 months ago

Payment Summary:

C+ Review - $500 @aimane-chnaif Offer sent in Upwork https://www.upwork.com/en-gb/jobs/~01a9cda98c1c4a1734

laurenreidexpensify commented 11 months ago

Payment Summary:

C+ Review - $500 @aimane-chnaif paid in Upwork