Skip to content
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

Populate chats from message center #9457

Closed
roryabraham opened this issue Jun 14, 2022 · 50 comments
Closed

Populate chats from message center #9457

roryabraham opened this issue Jun 14, 2022 · 50 comments
Assignees
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Monthly KSv2 NewFeature Something to build that is a new item.

Comments

@roryabraham
Copy link
Contributor

roryabraham commented Jun 14, 2022

Problem

NewDot mobile is prone to "ghost chats". They happen when:

  1. Your phone is locked and in your pocket and you have a network connection.
  2. You receive a push notification.
  3. (At this point, what ideally happens is that the app is woken in the background, the push notification is processed and saved in Onyx. All that code is implemented and in-place, but it's stringently regulated by the OS and dependent upon variables outside of our control, such as the battery level of the device. So we can't guarantee that it will always happen.)
  4. Because of things outside our control, the notification is not saved in Onyx.
  5. You lose your network connection for one reason or another.
  6. You then read the push notification message, and tap on the notification.
  7. The app opens the chat, but the message you just read is nowhere to be found. Because we don't have a network connection we can't load the missing chats over the network.

Solution

Disclaimer: I don't know if this is actually possible, but it's worth looking into. That's why I'm creating this issue...

When opening the app, read any new notifications in the "message center". Use the payloads of those notifications to populate the chats you received, without needing a network connection.

@roryabraham roryabraham added Engineering Monthly KSv2 Improvement Item broken or needs improvement. labels Jun 14, 2022
@roryabraham roryabraham self-assigned this Jun 14, 2022
@roryabraham
Copy link
Contributor Author

cc @Julesssss @AndrewGable – I don't know when I'll have time to look into this, but I think it's a good idea and might be a way to fix the "ghost messages" issue

@roryabraham roryabraham added the Internal Requires API changes or must be handled by Expensify staff label Jun 14, 2022
@roryabraham
Copy link
Contributor Author

This is internal because push notifications can't be tested by external contributors

@Julesssss
Copy link
Contributor

I can't speak for iOS here, but if a user opens the Android app by tapping a notification we can retrieve the app data from the Intent bundle. It seems that accessing the NotificationManagerService at app-open to read all notifications is NOT possible.

This doesn't solve for all cases, because the notification will only contain data for that specific chat. UNLESS we start sending all unread message data as part of the notification. Slightly hacky and maybe we'll eventually hit the 4kb limit, but this handles most cases.

@melvin-bot melvin-bot bot added the Overdue label Jul 15, 2022
@roryabraham
Copy link
Contributor Author

Haven't had time to investigate this yet. If anyone wants to help out with this feel free to self-assign and we can collaborate on it. If it's viable I think this could be a game-changer for the mobile apps.

@melvin-bot melvin-bot bot removed the Overdue label Jul 15, 2022
@Julesssss Julesssss self-assigned this Jul 19, 2022
@melvin-bot melvin-bot bot added the Overdue label Aug 15, 2022
@Julesssss
Copy link
Contributor

Julesssss commented Aug 16, 2022

No updates, remains low priority.

@melvin-bot melvin-bot bot removed the Overdue label Aug 16, 2022
@Julesssss
Copy link
Contributor

Hey @sketchydroide, do you know if it is possible to read all notifications from NotificationCenter in iOS? The only thing I could find was this hack from a 10 year old StackOverflow post.

It's not possible on Android, we can only access the notification intent & bundle if the user taps the notification.

@sketchydroide
Copy link
Contributor

I don't think so, but not 100% sure, notifications should be read if you are listening to them

@Julesssss
Copy link
Contributor

Julesssss commented Aug 23, 2022

notifications should be read if you are listening to them

Does this listener require that the app is open and|or in the foreground?

@sketchydroide
Copy link
Contributor

for push notifications no, iOS will open the app if necessary, or the push is open, if the app is in background it can still process notifications

@melvin-bot melvin-bot bot added the Overdue label Sep 26, 2022
@Julesssss
Copy link
Contributor

Held on the P/S

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2022
@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2022
@roryabraham
Copy link
Contributor Author

High-level design doc in review

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2022
@arielgreen arielgreen added NewFeature Something to build that is a new item. and removed Improvement Item broken or needs improvement. Bug Something is broken. Auto assigns a BugZero manager. labels Nov 8, 2022
@Julesssss Julesssss changed the title Populate chats from message center [HOLD] Populate chats from message center Nov 15, 2022
@roryabraham
Copy link
Contributor Author

Got tied up with deploy fires and improvements

@melvin-bot melvin-bot bot removed the Overdue label Jun 29, 2023
@roryabraham
Copy link
Contributor Author

Posted about this in slack: https://expensify.slack.com/archives/C04E99DVBTP/p1688080702244769

@melvin-bot melvin-bot bot added the Overdue label Jul 10, 2023
@roryabraham
Copy link
Contributor Author

Was OOO most of last week, I anticipate progress on this closer to the end of the week

@melvin-bot melvin-bot bot removed the Overdue label Jul 10, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 19, 2023
@roryabraham
Copy link
Contributor Author

No update yet this week, but this has been in the back of my mind. Just spread a little thin at the moment.

@melvin-bot melvin-bot bot removed the Overdue label Jul 20, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 28, 2023
@roryabraham
Copy link
Contributor Author

No update 😞

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2023
@roryabraham
Copy link
Contributor Author

Same

@melvin-bot melvin-bot bot removed the Overdue label Aug 9, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

This issue has not been updated in over 15 days. @roryabraham eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 5, 2023
@roryabraham
Copy link
Contributor Author

No update

@melvin-bot melvin-bot bot removed the Overdue label Oct 5, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@roryabraham
Copy link
Contributor Author

No update

@melvin-bot melvin-bot bot removed the Overdue label Nov 7, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 8, 2023
@roryabraham
Copy link
Contributor Author

Going to close this as it's not clear that it will be necessary in a world with #reliable-updates

@melvin-bot melvin-bot bot removed the Overdue label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Monthly KSv2 NewFeature Something to build that is a new item.
Projects
None yet
Development

No branches or pull requests

7 participants