Skip to content

VIDSOL-493: Migrate endpoints to use handler callbacks#434

Open
johnny-quesada-developer wants to merge 4 commits intodevelopfrom
johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks
Open

VIDSOL-493: Migrate endpoints to use handler callbacks#434
johnny-quesada-developer wants to merge 4 commits intodevelopfrom
johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks

Conversation

@johnny-quesada-developer
Copy link
Copy Markdown
Contributor

@johnny-quesada-developer johnny-quesada-developer commented Apr 7, 2026

What is this PR doing?

Migrates the backend /v2 API wiring and supporting tooling toward handler-callback–based routing, adds API-level integration tests, and refactors payload/error handling to align with the new routing approach.

Changes:

Refactors createVideoRouter/createVideoHandler to support transform/override/use callbacks and updates backend routing to mount /v2 via a dedicated video route.
Introduces Jest-based API integration tests under integration-tests/test-api and updates scripts/tsconfigs to support running them.
Adjusts API payload schemas and error export shape (notably omitting empty issues) and updates related tests.

How should this be manually tested?

Check everything works as before.

What are the relevant tickets?

A maintainer will add this ticket number.

Resolves VIDSOL-493

Checklist

[X] Branch is based on develop (not main).
[ ] Resolves a Known Issue.
[ ] If yes, did you remove the item from the docs/KNOWN_ISSUES.md?
[ ] Resolves an item reported in Issues.
If yes, which issue? Issue Number?

Copilot AI review requested due to automatic review settings April 7, 2026 16:39
@johnny-quesada-developer johnny-quesada-developer changed the title VIDSOL-493 Migrate endpoints to use handler callbacks VIDSOL-493: Migrate endpoints to use handler callbacks Apr 7, 2026
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

Migrates the backend /v2 API wiring and supporting tooling toward handler-callback–based routing, adds API-level integration tests, and refactors payload/error handling to align with the new routing approach.

Changes:

  • Refactors createVideoRouter/createVideoHandler to support transform/override/use callbacks and updates backend routing to mount /v2 via a dedicated video route.
  • Introduces Jest-based API integration tests under integration-tests/test-api and updates scripts/tsconfigs to support running them.
  • Adjusts API payload schemas and error export shape (notably omitting empty issues) and updates related tests.

Reviewed changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
scripts/testIntegration.ts Adds Jest-based API integration test runner alongside Playwright flow.
scripts/dev.ts Extends dev script to support backend-only debug modes.
libs/core/src/services/videoClient/createVideoClient.ts Tightens TRPC client typing for the video router client creation.
libs/common/src/errors/assertions/index.ts Simplifies assertion exports for common application errors.
libs/common/src/errors/ApplicationError.ts Omits empty issues from safe error exports.
libs/api/src/types/VideoAction.ts Adds doc comment for exported public API actions.
libs/api/src/types/index.ts Exports new handler-defaults typing.
libs/api/src/types/HandlersDefaults.ts Introduces HandlersDefaults mapped type for handler defaults.
libs/api/src/types/HandlerConfig.ts Makes defaults optional on handler configs.
libs/api/src/schemas/VideoRouterConfig.schema.ts Simplifies VideoRouterConfig generics and handler config typing.
libs/api/src/schemas/VideoClientConfig.schema.ts Adds handlersDefaults to VideoClient config schema/type.
libs/api/src/schemas/StopArchivePayload.schema.ts Updates stop-archive payload schema to only require archiveId.
libs/api/src/schemas/StartArchivePayload.schema.ts Makes archiveOptions optional for start-archive payload.
libs/api/src/schemas/DisableCaptionsPayload.schema.ts Updates disable-captions payload to only require captionsId.
libs/api/src/routing/videoRouter/index.ts Exports both default and named router factory exports.
libs/api/src/routing/videoRouter/createVideoRouter.ts Implements handler callback pipeline (transform/override/use) and context wiring changes.
libs/api/src/routing/videoRouter/createVideoRouter.test.ts Updates router tests to exercise the Express handler surface (supertest).
libs/api/src/routing/videoHandler/createVideoHandler.ts Refactors handler creation and exposes router extension callbacks on the middleware.
libs/api/src/routing/videoHandler/createVideoHandler.test.ts Reworks tests to validate behavior through HTTP requests.
libs/api/src/handlers/searchArchives.ts Updates third-party error message formatting callsite.
libs/api/src/errors/types/index.ts Exports new HttpError type.
libs/api/src/errors/types/HttpError.ts Adds HttpErrorLike shape for capturing HTTP client error details.
libs/api/src/errors/handlers/makeVideoApiErrorHandler/makeVideoApiErrorHandler.test.ts Updates expectations for omitted empty issues.
libs/api/src/errors/handlers/makeThirdPartyErrorHandler/makeThirdPartyErrorHandler.test.ts Updates expectations for omitted empty issues.
libs/api/src/errors/handlers/makeNotFoundErrorHandler/makeNotFoundErrorHandler.ts Adds not-found error handler builder.
libs/api/src/errors/handlers/makeNotFoundErrorHandler/index.ts Exposes not-found handler.
libs/api/src/errors/handlers/index.ts Exports not-found error handler from the handlers barrel.
libs/api/src/errors/assertions/isHttpError/isHttpError.ts Adds assertion for HTTP-shaped errors.
libs/api/src/errors/assertions/isHttpError/index.ts Exposes isHttpError assertion.
libs/api/src/errors/assertions/index.ts Updates assertions barrel exports and adds isHttpError.
libs/api/src/errors/ApplicationServerError.ts Enriches server error with HTTP response/config metadata when available.
libs/api/src/core/VideoClient/VideoClient.ts Adds handlersDefaults support and merges defaults into validated payloads.
libs/api/src/core/VideoClient/VideoClient.test.ts Updates tests to match new payload requirements (no sessionId for some actions).
libs/api/src/constants/index.ts Removes videoRouterContext export from constants barrel.
integration-tests/tsconfig.json Excludes Jest-based API test folder from Playwright integration TS config.
integration-tests/test-api/tsconfig.json Adds dedicated tsconfig for Jest-based API integration tests.
integration-tests/test-api/jest.config.js Adds Jest config for API integration tests.
integration-tests/test-api/apiIntegrity.test.ts Adds API integrity integration tests against a running backend server + TRPC client.
frontend/vite.config.ts Adds explicit Vitest API port config and exposes VONAGE_VIDEO_HOST env var.
frontend/src/VeraRoom/VeraRoomElement.spec.tsx Simplifies element tests by importing element module up-front.
FE_TO_BACKEND_REQUESTS.md Adds inventory doc of frontend→backend HTTP endpoints.
eslint.config.mjs Adds new Jest config file to ESLint “config files” list.
backend/tests/session.test.ts Updates backend session endpoint tests for new video API behavior/mocks.
backend/sessionStorageService.ts Memoizes session storage service instance.
backend/server.ts Removes inline /v2 mounting (moved to router).
backend/routes/video.ts Adds /v2 video router using createVideoHandler and handler defaults.
backend/routes/session.ts Refactors session REST endpoints to call the video client directly + new helper functions.
backend/routes/index.ts Mounts new /v2 video router.
backend/helpers/index.ts Adds helper barrel exports for session/video helpers.
backend/helpers/getSessionFromRoomName.ts Adds helper to fetch session by room name with not-found error.
backend/helpers/getOrCreateSessionFromRoomName.ts Adds helper to fetch-or-create session by room name with call blocking.
.vscode/extensions.json Removes VS Code Copilot extension recommendation entry.

@johnny-quesada-developer johnny-quesada-developer force-pushed the johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks branch 7 times, most recently from e0268e3 to 429e1c2 Compare April 12, 2026 03:31
… review

johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks advances review
@johnny-quesada-developer johnny-quesada-developer force-pushed the johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks branch 2 times, most recently from a11f19f to 0cbffd8 Compare April 13, 2026 14:54
@johnny-quesada-developer johnny-quesada-developer force-pushed the johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks branch from 0cbffd8 to 8748ef3 Compare April 13, 2026 16:31
@johnny-quesada-developer johnny-quesada-developer force-pushed the johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks branch 2 times, most recently from ee85a0d to b0fd811 Compare April 13, 2026 21:17
@johnny-quesada-developer johnny-quesada-developer force-pushed the johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks branch 4 times, most recently from 7982b5d to 2146290 Compare April 14, 2026 07:01
@johnny-quesada-developer johnny-quesada-developer force-pushed the johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks branch from 2146290 to 3de7b11 Compare April 14, 2026 07:21
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 14, 2026

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.

4 participants