question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pinpoint - new endpoints are created for the user without deleting the old ones, which causes the number of endpoints to reach 10 (which is the max)

See original GitHub issue

Describe the bug In my React Native app I call the updateEndpoint function whenever the app starts so that it creates an endpoint for my user if it doesn’t exist, and update data if the endpoint already exists (Demographic, Location etc). What I think happens is that it creates an endpoint every time, and using the AWS CLI to list endpoints for my user I can see a lot of endpoints that have the INACTIVE status, and then an endpoint with the same address that has an ACTIVE status, according to the docs -

Amazon Pinpoint automatically sets this value to ACTIVE when you create an endpoint or update an existing endpoint. Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.

Maybe is there a way that Amplify can check if there are INACTIVE endpoints for the user then delete them? And if there are active endpoints for the user then use them and do not create new ones.

To Reproduce Call Analytics.updateEndpoint with the notification token of the device when the app starts, after a few times (some re-installs, different app builds) you will see you have a lot of endpoint even though you are only using a single device.

Expected behavior Analytics.updateEndpoint() function knows how to handle existing endpoints, new endpoints, old endpoints…

Code Snippet

await Analytics.updateEndpoint({
  address: pushToken,
  userId: userId,
  userAttributes: {
    ...userAttributes,
  },
  optOut: 'NONE',
});

What is Configured? the fields that exist in the aws-exports file are

aws_project_region
aws_cognito_identity_pool_id
aws_cognito_region
aws_user_pools_id
aws_user_pools_web_client_id
aws_appsync_graphqlEndpoint
aws_appsync_region
aws_appsync_authenticationType
aws_user_files_s3_bucket
aws_user_files_s3_bucket_region
aws_mobile_analytics_app_id
aws_mobile_analytics_app_region

and the custom config for Amplify.configure looks like this

const config = {
  ...aws_exports,
  graphql_headers: async () => {
    try {
      const token = (await Auth.currentSession()).getIdToken().getJwtToken();
      return { Authorization: token };
    } catch (e) {
      console.error(e);
      return {};
    }
  },
  Auth: {
    storage: AmplifyCommunityAsyncStorage,
  },
  PushNotification: {
    appId: aws_exports.aws_mobile_analytics_app_id,
    requestIOSPermissions: false,
  },
};

Additional context Maybe I am using Analytics.updateEndpoint() wrong… I would be happy to see what the recommended usage it, because the docs don’t say anything about usage - they just show a very simple example and no real usage which is disappointing.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
pcolmercommented, Jan 21, 2022

So @hkjpotato committed #8992 to set the channel type to PUSH for web analytics but then, seemingly, undid that commit with #8999.

Does that mean we still don’t have a fix for web analytics?

We’re using AWS Amplify only with web browsers, so we don’t have “devices” to worry about. All of our endpoints are set to the logged-in user’s email address but because the RequestId value changes each time, new endpoints are being created over and over again for the same user.

For web analytics, I just want one endpoint per user. Is that really so hard to achieve?

2reactions
sammartinezcommented, Feb 9, 2021

Thank you for providing this feedback. Since Amplify JS is a proxy to the Amazon Pinpoint service, I have marked this as a feature request and will let the Pinpoint service team know about this feature request. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting endpoints from Amazon Pinpoint
You can delete endpoints when you no longer want to message a certain destination—such as when the destination becomes unreachable, or when a...
Read more >
Pinpoint — Boto3 Docs 1.26.37 documentation - Amazon AWS
The maximum number of messages that a campaign can send to a single endpoint during a 24-hour period. For an application, this value...
Read more >
TeamViewer Remote Management User Guide
Operating System requirements for Malwarebytes Endpoint Protection. ... Remote Management can be used even without a TeamViewer Corporate, Premium, or.
Read more >
Cisco DNA Center 2.3.3 Data Sheet
The solution receives data in the form of streaming telemetry from every device (switch, router, access point, and wireless access controller) on the...
Read more >
RealAccess Cloud Edition Operations Guide
To get started with the Polycom® RealAccess™, Cloud Edition Service Delivery Platform, ... Software release and how many endpoints are running each release....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found