storacha / w3infra

🏗️ Infra for the w3up UCAN protocol implementation
Other
17 stars 7 forks source link

fix: consumerTable.get returns customer #435

Closed fforbeck closed 3 days ago

fforbeck commented 3 days ago

Context

While testing the Egress Tracking System in Staging, an error occurred indicating that the router couldn't resolve the customer:

✘ [ERROR] Failed to record egress for space did:key:z6MkkYoZNccuPxDxc8kh6YgPSZwyXCqeS2QYqhtQtYyEKYTt {
    name: 'FieldError',
    message: 'Object contains invalid field "customer":\n' +
      '  - Expected value of type string instead got undefined'
    ...

Issue

The error arises because the consumerTable.get query does not include the customer field in its projection, despite the customer existing in consumerTable and being manually retrievable.

Fix

This PR updates the consumerTable.get query to ensure the customer field is projected correctly, allowing the router to resolve the customer as expected. It also fixes the related tests to reflect this change accurately.

seed-deploy[bot] commented 3 days ago
View stack outputs - **pr435-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr435-w3infra-customer egressTrafficTableName | pr435-w3infra-egress-traffic spaceDiffTableName | pr435-w3infra-space-diff spaceSnapshotTableName | pr435-w3infra-space-snapshot usageTable | pr435-w3infra-usage - **pr435-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://hs12jzyvl8.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://k4qkmlefnukaguqkuij25sl2ra0getlp.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr435.billing.web3.storage EgressTrafficQueueURL | https://sqs.us-east-2.amazonaws.com/505595374361/pr435-w3infra-egress-traffic-queue - **pr435-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr435-0 Region | us-east-2 - **pr435-w3infra-PSAStack** Name | Value -- | -- downloadFunctionURL | https://p4wkkwdp6eltuc6ae6klag2cfe0brmsq.lambda-url.us-east-2.on.aws/ hashFunctionURL | https://yogiqz75djsu4yqvye4snkmy6y0fyvcv.lambda-url.us-east-2.on.aws/ - **pr435-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://0xwun5bxtl.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr435.roundabout.web3.storage - **pr435-w3infra-UcanInvocationStack** Name | Value -- | -- invocationBucketName | invocation-store-pr435-0 taskBucketName | task-store-pr435-0 workflowBucketName | workflow-store-pr435-0 - **pr435-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoints | ["https://ckn28jk1i0.execute-api.us-east-2.amazonaws.com","https://9oooj63972.execute-api.us-east-2.amazonaws.com"] CustomDomains | ["https://pr435.up.web3.storage","https://pr435.up.storacha.network"] - **pr435-w3infra-BusStack** - **pr435-w3infra-FilecoinStack** - **pr435-w3infra-IndexerStack** - **pr435-w3infra-ReplicatorStack** - **pr435-w3infra-UcanFirehoseStack** - **pr435-w3infra-UploadDbStack**