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

Grant/Revoke not firing on entitlement update #80

Open
MartinEmrich opened this issue Aug 13, 2024 · 0 comments
Open

Grant/Revoke not firing on entitlement update #80

MartinEmrich opened this issue Aug 13, 2024 · 0 comments

Comments

@MartinEmrich
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant