Skip to content

[HOTE-1074] feat: session repository#349

Open
billwirz1 wants to merge 8 commits intomainfrom
feature/hote-1074/session-db-service
Open

[HOTE-1074] feat: session repository#349
billwirz1 wants to merge 8 commits intomainfrom
feature/hote-1074/session-db-service

Conversation

@billwirz1
Copy link
Copy Markdown
Contributor

@billwirz1 billwirz1 commented Apr 13, 2026

Description

Implements a new SessionDbClient repository in lambdas/src/lib/db/ to provide CRUD operations for the session table, including shared retry/backoff logic intended for transient Aurora/Postgres connectivity issues.

Changes:

Added SessionDbClient with createSession, getSession, updateSession, and deleteSession, using parameterised SQL and a whitelist-driven update builder.
Introduced db-retry helper (isTransientDatabaseError, executeDbOperationWithRetry) with exponential backoff + jitter defaults.
Added Jest unit tests covering the new session repository and retry helper behaviour.

Context

Description:
Implement a CRUD wrapper for interacting with the session table. Use existing standards and practice.

Acceptance Criteria:

createSession(session)
getSession(sessionId)
updateSession(sessionId, updates)
deleteSession(sessionId)
Includes retry/backoff + Aurora connection best practices.

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.

Copilot AI review requested due to automatic review settings April 13, 2026 15:27
@billwirz1 billwirz1 changed the title [HOTE-1073] feat: session repository [HOTE-1074] feat: session repository Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Lambdas Coverage Report

Lines Statements Branches Functions
Coverage: 98%
98.54% (1553/1576) 92.87% (430/463) 96.99% (258/266)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

UI Coverage Report

Lines Statements Branches Functions
Coverage: 96%
96.16% (5669/5895) 88.22% (682/773) 88.06% (214/243)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements a new SessionDbClient repository in lambdas/src/lib/db/ to provide CRUD operations for the session table, including shared retry/backoff logic intended for transient Aurora/Postgres connectivity issues.

Changes:

  • Added SessionDbClient with createSession, getSession, updateSession, and deleteSession, using parameterised SQL and a whitelist-driven update builder.
  • Introduced db-retry helper (isTransientDatabaseError, executeDbOperationWithRetry) with exponential backoff + jitter defaults.
  • Added Jest unit tests covering the new session repository and retry helper behaviour.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
lambdas/src/lib/db/session-db-client.ts New session table CRUD client; wraps DB operations with retry and maps DB rows to the shared ISession model.
lambdas/src/lib/db/session-db-client.test.ts Unit tests for session CRUD behaviour and retry on transient failures.
lambdas/src/lib/db/db-retry.ts New generic retry/backoff utility for DB operations with transient error classification.
lambdas/src/lib/db/db-retry.test.ts Unit tests verifying retry logic timing and transient error detection.

Copilot AI review requested due to automatic review settings April 13, 2026 16:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings April 14, 2026 12:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

@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.

2 participants