Skip to content

TEC-1960: adds unit tests for socket handlers - #17

Merged
swagnikdutta merged 27 commits into
mainfrom
adds-unit-tests
Mar 26, 2026
Merged

TEC-1960: adds unit tests for socket handlers#17
swagnikdutta merged 27 commits into
mainfrom
adds-unit-tests

Conversation

@swagnikdutta

@swagnikdutta swagnikdutta commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@swagnikdutta
swagnikdutta changed the base branch from main to feat/socket-io-migration February 27, 2026 11:07
@swagnikdutta
swagnikdutta force-pushed the adds-unit-tests branch 2 times, most recently from c4e3920 to b2ef239 Compare February 28, 2026 15:24
Base automatically changed from feat/socket-io-migration to main March 2, 2026 10:21
@swagnikdutta
swagnikdutta force-pushed the adds-unit-tests branch 4 times, most recently from 997842f to 1d7d7b8 Compare March 4, 2026 13:59
@swagnikdutta swagnikdutta changed the title Adds unit tests adds unit tests for all socket handlers Mar 5, 2026
@swagnikdutta
swagnikdutta marked this pull request as ready for review March 5, 2026 14:43
@swagnikdutta swagnikdutta changed the title adds unit tests for all socket handlers TEC-1960: adds unit tests for socket handlers Mar 10, 2026
@swagnikdutta
swagnikdutta force-pushed the adds-unit-tests branch 2 times, most recently from 8c37616 to 709a2ba Compare March 10, 2026 11:37
Comment thread src/services/socket-handlers.ts Outdated
const filterParams = { documentId, sessionDid: socket.data.sessionDid };
const [updates, total] = await Promise.all([
mongodbStore.getUpdatesByDocument(filterParams, { committed: filters.committed }),
mongodbStore.getUpdatesByDocument(filterParams, { offset, limit, sort, committed: filters.committed }),

@swagnikdutta swagnikdutta Mar 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nadeem-fileverse I had to add these option flags in the function call as existing tests were failing.

But I see you had removed these recently here. So I'm assuming there was a reason behind it.

  • I would like to understand the reason. And what is the actionable now?
  • Should we add the pagination back?
  • Or should I update the unit test to satisfy the function call without pagination parameters?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pagination is disabled atm you should adjust your test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cool. Can you share the reasoning behind removing pagination for now?

@swagnikdutta
swagnikdutta force-pushed the adds-unit-tests branch 3 times, most recently from 3f957fa to cf75c4c Compare March 18, 2026 08:51
@nadeem-fileverse

Copy link
Copy Markdown
Contributor

Test files use raw string literals ("NOT_AUTHENTICATED", "SESSION_NOT_FOUND", etc.) instead of the ErrorCode enum.

@nadeem-fileverse

Copy link
Copy Markdown
Contributor

This looks good so far, but we should also test for session-manager and broadcast-bridge

@swagnikdutta

Copy link
Copy Markdown
Contributor Author

@nadeem-fileverse Added tests for session-manager and broadcast-bridge.

@nadeem-fileverse nadeem-fileverse left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@swagnikdutta
swagnikdutta merged commit 69c63c7 into main Mar 26, 2026
1 check passed
@swagnikdutta
swagnikdutta deleted the adds-unit-tests branch March 26, 2026 08:01
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