Skip to content

Conversation

@francisco-videira-nhs
Copy link
Contributor

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@francisco-videira-nhs francisco-videira-nhs requested review from a team as code owners December 1, 2025 22:12
francisco-videira-nhs and others added 26 commits December 2, 2025 15:53
m-houston
m-houston previously approved these changes Dec 19, 2025
};

function createDocumentClient(): DynamoDBDocumentClient {
const ddbClient = new DynamoDBClient({});
Copy link

@Vlasis-Perdikidis Vlasis-Perdikidis Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the region be passed in during creation?
Which region is used by default if you omit it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html :

  • "The SDK for JavaScript doesn't select a Region by default. However, you can set the AWS Region using an environment variable, or a shared configuration config file."
  • "Order of precedence for setting the Region": passed to constructor -> env var -> shared config file

From what I can tell, the Lambda service itself injects env vars depending on where it is deployed, and then the SDK will pick it up. We could be clearer and have fallbacks though when creating the clients, I think we need a tech debt for this because other Lambdas in the project are creating the clients like this as well

@masl2 masl2 dismissed stale reviews from Vlasis-Perdikidis and m-houston via 547f6b1 December 24, 2025 10:42
masl2 and others added 2 commits December 24, 2025 11:03
* swap partition and sort for letters

* store changes and source, subject, billingref

* unsafe marker

* rename correctly
masl2
masl2 previously approved these changes Dec 24, 2025
Comment on lines 217 to 237
test("processes all v1 records successfully and returns no batch failures", async () => {
const evt: SQSEvent = {
Records: [
createSqsRecord(
"msg1",
JSON.stringify(createNotification(createPreparedV1Event())),
),
createSqsRecord(
"msg2",
JSON.stringify(
createNotification(
createPreparedV1Event({
id: "7b9a03ca-342a-4150-b56b-989109c45614",
domainId: "letter2",
url: "s3://letterDataBucket/letter2.pdf",
}),
),
),
),
],
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A parameterised test structure might be worth considering - maybe as a tech debt - as for each path (insert or upsert) I expect regardless of the supported event input we would want the same outputs.
Although it would still require extra tests for mixed events etc, I wonder if it might be easier to maintain/reduce the boilerplate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to reduce the boilerplate. Yeah there can be a mix of input/outcome... With parameterised maybe we'd lose what the test is doing if we lose the descriptions? Can raise a tech debt though


await Promise.all(tasks);

return { batchItemFailures };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does batch failure support not require a terraform configuration to be set on the queue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

5 participants