VIDSOL-493: Migrate endpoints to use handler callbacks#434
Open
johnny-quesada-developer wants to merge 4 commits intodevelopfrom
Open
VIDSOL-493: Migrate endpoints to use handler callbacks#434johnny-quesada-developer wants to merge 4 commits intodevelopfrom
johnny-quesada-developer wants to merge 4 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
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/createVideoHandlerto support transform/override/use callbacks and updates backend routing to mount/v2via a dedicatedvideoroute. - Introduces Jest-based API integration tests under
integration-tests/test-apiand 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. |
e0268e3 to
429e1c2
Compare
… review johnny/VIDSOL-493-Migrate-endpoints-to-use-handler-callbacks advances review
a11f19f to
0cbffd8
Compare
frontend/src/components/MeetingRoom/RecordingPopupIndicator/RecordingPopupIndicator.spec.tsx
Fixed
Show fixed
Hide fixed
frontend/src/components/MeetingRoom/SmallViewportHeader/SmallViewportHeader.spec.tsx
Fixed
Show fixed
Hide fixed
0cbffd8 to
8748ef3
Compare
ee85a0d to
b0fd811
Compare
7982b5d to
2146290
Compare
2146290 to
3de7b11
Compare
|
OscarFava
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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(notmain).[ ] 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?