Skip to content

OJ-3227 - Improvements to common code#649

Merged
barnabycollins merged 1 commit into
mainfrom
OJ-3227-common-refactor
Jul 14, 2025
Merged

OJ-3227 - Improvements to common code#649
barnabycollins merged 1 commit into
mainfrom
OJ-3227-common-refactor

Conversation

@barnabycollins
Copy link
Copy Markdown
Contributor

@barnabycollins barnabycollins commented Jul 9, 2025

Proposed changes

What changed

  • Changed db functions to perform TTL filtering in the data layer
    • Simplifies application code, unit tests & error handling
    • Might marginally improve performance 👀
  • Moved various utilities from nino-check to common, ready for the issue-credential function
  • Improved error logging by making safeStringifyError log the full String(error) when outside prod
    • This should make troubleshooting significantly easier when looking into unexpected 500s outside prod
    • This requires that we explicitly set LOG_FULL_ERROR=true in the environment variables, so it should not accidentally get switched on in prod
    • If not set, we still log Error.name / typeof error as before
  • Refactored function config classes to extend a bass class to avoid repetition for common config (audit, table names)

Why did it change

These improvements make the code more maintainable, and will provide a solid foundation for the issue-credential Lambda work.

Issue tracking

Checklists

Environment variables or secrets

  • Documented in the README
  • Added to deployment repository
  • Added to local startup repository

Other considerations

  • Update README with any new instructions or tasks

@barnabycollins barnabycollins requested review from a team as code owners July 9, 2025 15:40
@barnabycollins barnabycollins force-pushed the OJ-3227-common-refactor branch from e45bf30 to 0a7b65f Compare July 9, 2025 16:02
Comment thread infrastructure/template.yaml Outdated
Comment thread lambdas/common/src/database/get-record-by-session-id.ts
Comment thread lambdas/common/src/database/retrieve-person-identity.ts Outdated
Comment thread lambdas/nino-check/tsconfig.json Outdated
Comment thread lambdas/common/src/util/stringify-error.ts
Comment thread lambdas/common/tests/database/count-attempts.test.ts
@sonarqubecloud
Copy link
Copy Markdown

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