Skip to content

Grant/Revoke not firing on entitlement update #80

Open
@MartinEmrich

Description

@MartinEmrich

Describe the bug
Upon entitlement update (e.g. change my the subscriber/customer), there is no message on the SupportSNS topic.

To Reproduce
Steps to reproduce the behavior:

  1. set up everythin
  2. Buy the product from a test account
  3. later, edit the product dimensions from the test account

Expected behavior
The "entitlement-updated" message should be sent to the SupportSNS topic

More details

At this part, it continues only if both old and new "entitlement" entry are present, and they must differ.
https://github.com/aws-samples/aws-marketplace-serverless-saas-integration/blob/master/src/grant-revoke-access-to-product.js#L44-L46

But upon change of dimensions, there are two Changes done to the DynamoDB:

  1. https://github.com/aws-samples/aws-marketplace-serverless-saas-integration/blob/master/src/register-new-subscriber.js#L75-L104 writes a Put to DynamoDB without the "entitlement" field set. That Stream Message will not have it in the "new" object. Then it sends to the Entitlement Topic.
  2. that triggers https://github.com/aws-samples/aws-marketplace-serverless-saas-integration/blob/master/src/entitlement-sqs.js#L31-L45, it writes an Update to the DynamoDB. That Stream Message will not have it in the "old" object.

So in neither case, both "old" and "new" object will have the entitlement, so "grant-revoke-access-to-product" will not send a message to the SupportSNS topic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions