Skip to content

Conversation

konstantinabl
Copy link
Contributor

@konstantinabl konstantinabl commented Oct 14, 2025

Description

This PR introduces the usage of an init method for initialization of the Relay class instead of using the constructor.
This allows us doing asynchronous operations, like creating a redis client on creation

Related issue(s)

Fixes #4470

Changes from original design (optional)

N/A

Additional work needed (optional)

N/A

Checklist

  • I've assigned an assignee to this PR and related issue(s) (if applicable)
  • I've assigned a label to this PR and related issue(s) (if applicable)
  • I've assigned a milestone to this PR and related issue(s) (if applicable)
  • I've updated documentation (code comments, README, etc. if applicable)
  • I've done sufficient testing (unit, integration, etc.)

…inclusion; create initialize methods for server and websocket

Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl linked an issue Oct 14, 2025 that may be closed by this pull request
10 tasks
Copy link

github-actions bot commented Oct 14, 2025

Test Results

 20 files  ±0  265 suites  ±0   28m 59s ⏱️ + 8m 6s
764 tests +1  758 ✅  - 1  4 💤 ±0  2 ❌ +2 
780 runs  +1  774 ✅  - 1  4 💤 ±0  2 ❌ +2 

For more details on these failures, see this check.

Results for commit 071aa7c. ± Comparison against base commit c2c0cd4.

♻️ This comment has been updated with latest results.

Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl self-assigned this Oct 14, 2025
@konstantinabl konstantinabl added the enhancement New feature or request label Oct 14, 2025
@konstantinabl konstantinabl added this to the 0.73.0 milestone Oct 14, 2025
@konstantinabl konstantinabl marked this pull request as ready for review October 14, 2025 14:47
@konstantinabl konstantinabl requested review from a team as code owners October 14, 2025 14:47
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

looking okay so far. Couple of items

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl marked this pull request as draft October 16, 2025 13:33
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl marked this pull request as ready for review October 16, 2025 15:00
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Just some items seem out side the scope of the PR without explanation so I kept asking around.

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl requested a review from a team October 17, 2025 10:55
Signed-off-by: Konstantina Blazhukova <[email protected]>
@simzzz
Copy link
Contributor

simzzz commented Oct 17, 2025

Should we also replace relay = new Relay(logger, new Registry()); everywhere in the tests with relay = await Relay.init(logger, new Registry());?

@konstantinabl
Copy link
Contributor Author

Should we also replace relay = new Relay(logger, new Registry()); everywhere in the tests with relay = await Relay.init(logger, new Registry());?

@simzzz fixed

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Copy link
Contributor

@simzzz simzzz left a comment

Choose a reason for hiding this comment

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

LGTM

@konstantinabl konstantinabl merged commit 533a976 into main Oct 20, 2025
61 of 67 checks passed
@konstantinabl konstantinabl deleted the 4470-refactor-relay-initialization-to-use-static-factory-method-pattern branch October 20, 2025 10:54
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 92.83333% with 43 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/server/src/server.ts 88.88% 19 Missing ⚠️
packages/ws-server/src/webSocketServer.ts 95.43% 9 Missing ⚠️
packages/server/src/index.ts 0.00% 8 Missing ⚠️
packages/ws-server/src/index.ts 0.00% 7 Missing ⚠️
@@           Coverage Diff           @@
##             main    #4471   +/-   ##
=======================================
  Coverage   96.22%   96.23%           
=======================================
  Files         121      121           
  Lines       19943    20001   +58     
  Branches     1752     1756    +4     
=======================================
+ Hits        19191    19247   +56     
- Misses        733      735    +2     
  Partials       19       19           
Flag Coverage Δ
config-service 98.80% <ø> (ø)
relay 91.17% <12.44%> (-0.07%) ⬇️
server 88.85% <86.54%> (+0.03%) ⬆️
ws-server 98.04% <94.92%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/relay/src/lib/config/methodConfiguration.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/relay.ts 97.82% <100.00%> (+0.15%) ⬆️
packages/ws-server/src/index.ts 0.00% <0.00%> (ø)
packages/server/src/index.ts 0.00% <0.00%> (ø)
packages/ws-server/src/webSocketServer.ts 96.83% <95.43%> (-1.74%) ⬇️
packages/server/src/server.ts 87.57% <88.88%> (+0.45%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Relay initialization to use Static Factory Method pattern

4 participants