Skip to content

Refactor: Modernize SocketService, remove hardcoded URL, and update RxJS#79

Open
Anurag-elitx wants to merge 1 commit into
PSMRI:mainfrom
Anurag-elitx:refactor/socket-modernization
Open

Refactor: Modernize SocketService, remove hardcoded URL, and update RxJS#79
Anurag-elitx wants to merge 1 commit into
PSMRI:mainfrom
Anurag-elitx:refactor/socket-modernization

Conversation

@Anurag-elitx

Copy link
Copy Markdown

📋 Description

JIRA ID: #130

This PR modernizes the SocketService by addressing legacy patterns that hinder the migration to Angular 19 and RxJS 7+.

Key Changes:

  1. Removed Hardcoded URL: Moved the hardcoded IP address http://10.208.122.38:4000/ out of the service and into the environment configuration. It is now exposed via ConfigService.
  2. Updated Deprecated RxJS: Replaced Observable.create() with the standard new Observable() constructor in getMessages and getDebugMessage.
  3. Improved Connection Management: Added @Injectable() decorator and ensured that re-instantiating the socket disconnects the old one first to prevent memory leaks and duplicate listeners.
  4. Environment Template: Added SOCKET_URL to environment.ci.ts.template to guide other developers on required configuration.

✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

  • Verified that the service structure aligns with modern Angular practices.
  • The change is non-breaking as the default URL remains the same (via environment), but it is now configurable.

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Anurag-elitx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 16 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8139b8da-83da-4417-8a4a-2c3538849b3a

📥 Commits

Reviewing files that changed from the base of the PR and between df5db19 and 7a56356.

📒 Files selected for processing (3)
  • src/app/services/config/config.service.ts
  • src/app/services/socketService/socket.service.ts
  • src/environments/environment.ci.ts.template
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant