Aws-sdk-js: Pinpoint: removeAttributes API not deleting the user attributes

Created on 24 Mar 2020  路  9Comments  路  Source: aws/aws-sdk-js

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
I have been trying the removeAttributes API for Pinpoint to remove a specific user attribute from all the endpoints. But, whenever I call this API, I get a response with blacklisted attributes which are all the fields except for what I have given in the request. But, when I get the endpoint using getEndpoint, I can see all the attributes intact. I tried updating to the latest version of the SDK. But nothing changed.

Is the issue in the browser/Node.js?
Node.js

If on Node.js, are you running this on AWS Lambda?
Yes

Details of the browser/Node.js version
Paste output of npx envinfo --browsers or node -v
Using the Node.js 10.x Runtime for Lambda

SDK version number
v2.643.0

To Reproduce (observed behavior)

const params = {
        ApplicationId: 'Pinpoint-AppId', /* required */
        AttributeType: 'endpoint-user-attributes', /* required */
        UpdateAttributesRequest: { /* required */
            Blacklist: ['uuid1(user-attribute-1)', 'uuid2(user-attribute-2)']
        }
};
const removeAttributesResp = await pinpoint.removeAttributes(params).promise();

Expected behavior
It should delete the user attributes given in the 'Blacklist' field from all endpoints.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

bug investigating

Most helpful comment

I have exactly the same problem.

The docs are wrong - they claim that it should return the removed attributes but in fact it returns the remaining attributes.

I have tried this operation using the:

  1. AWS Java SDK
  2. AWS CLI
  3. AWS REST API

The results are identical in every case.

Please can we get an update on this?

All 9 comments

Have you followed the steps to use the latest SDK when working with Lambda?

Can you please check the version by printing the output of AWS.VERSION in your code where you have AWS = require("aws-sdk");

It might be the case that you are using an older version of the SDK if you have not bundled the SDK to use in your application.

@ajredniwja I'm using a Lambda Layer with the latest version of aws-sdk. The output of AWS.VERSION is 2.646.0. Updated and tried today. Not working still.

@deepakpc In order for removeAttribute to work with blacklisted attribute you have to specify exact name of each attribute to remove or the Blacklist array can specify a glob pattern that an attribute name must match in order for the attribute to be removed.
Can you make sure that you are sending the attribute in correct pattern?

https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-attributes-attribute-type.html#apps-application-id-attributes-attribute-typeput

@ajredniwja Yes. I am sending the exact attribute name in the Blacklist array. In my case, the attribute name that I gave is a UUID. For example: "081fb620-7244-11ea-a350-b7f82e08a699".

@ajredniwja Any new updates on this issue?

I have exactly the same problem.

The docs are wrong - they claim that it should return the removed attributes but in fact it returns the remaining attributes.

I have tried this operation using the:

  1. AWS Java SDK
  2. AWS CLI
  3. AWS REST API

The results are identical in every case.

Please can we get an update on this?

@fotherda71 @deepakpc Hey guys, were you able to resolve this issue? I notice the same in Python boto SDK.

@fotherda71 @deepakpc Hey guys, were you able to resolve this issue? I notice the same in Python boto SDK.

No. I had contacted AWS developer support and they said it was an issue on their end after contacting the Pinpoint development team. They suggested me a "workaround" which was to delete the endpoints that have the attributes to be removed and re-create them without those attributes.

@deepakpc Oh, alright! Thank you for your quick response 馃憤

Was this page helpful?
0 / 5 - 0 ratings