From f1895af575335b8660acd5f54ec818028c2b6060 Mon Sep 17 00:00:00 2001 From: Tom Wey Date: Tue, 19 Mar 2024 12:50:40 +0000 Subject: [PATCH 1/3] Make platform available here So that we can filter on it. --- dynamo.cloudformation.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/dynamo.cloudformation.yaml b/dynamo.cloudformation.yaml index bb58f4195..a888c8098 100644 --- a/dynamo.cloudformation.yaml +++ b/dynamo.cloudformation.yaml @@ -93,6 +93,7 @@ Resources: Projection: NonKeyAttributes: - autoRenewing + - platform - receipt ProjectionType: INCLUDE Tags: From 3913ed09323d271f65b58f862b4df19a148bf872 Mon Sep 17 00:00:00 2001 From: Tom Wey Date: Tue, 19 Mar 2024 13:00:37 +0000 Subject: [PATCH 2/3] Create a new secondary index instead of altering existing Editing the existing index failed with: Resource handler returned message: "Cannot update GSI's properties other than Provisioned Throughput and Contributor Insights Specification. You can create a new GSI with a different name." (RequestToken: b8bf0056-d503-81c6-ff7e-2801e104abed, HandlerErrorCode: InvalidRequest) --- dynamo.cloudformation.yaml | 11 +++++++++++ .../revalidate-receipts/appleRevalidateReceipts.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dynamo.cloudformation.yaml b/dynamo.cloudformation.yaml index a888c8098..17655e6a0 100644 --- a/dynamo.cloudformation.yaml +++ b/dynamo.cloudformation.yaml @@ -85,6 +85,17 @@ Resources: StreamViewType: NEW_AND_OLD_IMAGES GlobalSecondaryIndexes: - IndexName: ios-endTimestamp-revalidation-index + KeySchema: + - AttributeName: subscriptionId + KeyType: HASH + - AttributeName: endTimestamp + KeyType: RANGE + Projection: + NonKeyAttributes: + - autoRenewing + - receipt + ProjectionType: INCLUDE + - IndexName: ios-endTimestamp-revalidation-index-with-platform KeySchema: - AttributeName: subscriptionId KeyType: HASH diff --git a/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts b/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts index 5af19e1ad..1912291e2 100644 --- a/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts +++ b/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts @@ -59,7 +59,7 @@ export async function handler(event: ScheduleEvent) { const queryScan = dynamoMapper.scan( EndTimeStampFilterSubscription, { - indexName: 'ios-endTimestamp-revalidation-index', + indexName: 'ios-endTimestamp-revalidation-index-with-platform', filter: filter }); From 4467a02b361088fa9cb64105fd051b3481549d6f Mon Sep 17 00:00:00 2001 From: Tom Wey Date: Tue, 19 Mar 2024 13:26:17 +0000 Subject: [PATCH 3/3] Don't start using it yet --- typescript/src/revalidate-receipts/appleRevalidateReceipts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts b/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts index 1912291e2..5af19e1ad 100644 --- a/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts +++ b/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts @@ -59,7 +59,7 @@ export async function handler(event: ScheduleEvent) { const queryScan = dynamoMapper.scan( EndTimeStampFilterSubscription, { - indexName: 'ios-endTimestamp-revalidation-index-with-platform', + indexName: 'ios-endTimestamp-revalidation-index', filter: filter });