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

Bug: Android bug on new message received #1520

Closed
technoplato opened this issue Jan 14, 2025 · 3 comments
Closed

Bug: Android bug on new message received #1520

technoplato opened this issue Jan 14, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@technoplato
Copy link
Collaborator

Describe the bug

 LOG  4:17:15 PM | DEBUG : [Notifications] Handling iOS foreground notification 
 ERROR  TaskManager: Task "BACKGROUND-NOTIFICATION-TASK" failed: [TypeError: Cannot read property 'data' of null]

CleanShot 2025-01-14 at 16 19 17@2x

Expected behavior

No response

Steps to reproduce the bug

No response

@technoplato technoplato added the bug Something isn't working label Jan 14, 2025
@technoplato
Copy link
Collaborator Author

Caused by notification triggered when a message was sent as sender on Android device;

    /**
{
  "originalPriority": 2,
  "sentTime": 1736890326588,
  "notification": null,
  "data": {
    "channelId": "converse-notifications",
    "body": "{\"contentTopic\":\"/xmtp/mls/1/g-3d292583b3ba838a8e59ed56a0216080/proto\",\"message\":\"Cp0CCL32AhCgh8G8ypGrjRgaED0pJYOzuoOKjlntVqAhYIAi2AEAAQACED0pJYOzuoOKjlntVqAhYIAAAAAAAAAAAQEAHHaPz3ebl+Hiyb25o4PdDqJBbt11GRAWGxgPoRFAmttvoA7i10blKatFAhJYkCtHrjaqSypllK2jixMzOMKW64ZDyWj0UgMqVtF7YNnag1WUlLhAZHbz7Ye3qdfT2ponxDzbPp/QuKvI78OJrde73xJ2MdErm++mpYq3qxLz285oRMa5hj4LOL6TknBIHuY0kxPvlUiESFRnByyx5fufGTjD+GAH0ON0nNMs6mikY1PJwz9BhKbe2VkqICrjskIVfCoVExBOEfVUuwnj/maklkOzRRPr2yBOh5xh\",\"timestampNs\":\"1736890326411396000\",\"account\":\"0x68E7cF070fcEe941bD86712D26DcA314B78ae2A6\",\"sentViaConverse\":false}",
    "priority": "high"
  },
  "to": null,
  "ttl": 2419200,
  "collapseKey": null,
  "messageType": null,
  "priority": 2,
  "from": "564961909146",
  "messageId": "0:1736890326607359%64bc37e7f9fd7ecd"
}

    \

     */

and bandaided with

const notificationBody =
  ((data as any).notification?.data?.body as string | undefined) || // Protocol notifications use body (legacy, to support older versions of the app)
  ((data as any).notification?.data?.data as string | undefined); // Converse notifications use data (legacy, to support older versions of the app)
if (!notificationBody) {
  logger.error(
    `${Platform.OS} ${BACKGROUND_NOTIFICATION_TASK}: No notification body found`
  );
  return;
}

@technoplato
Copy link
Collaborator Author

bandaided here: f4824a4

@technoplato
Copy link
Collaborator Author

gonna close - we'll figure out notifications later in a more consoldiated way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant