Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/ws-reconnect-on-dev-shut-down #852

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

PatrykKuniczak
Copy link
Collaborator

@PatrykKuniczak PatrykKuniczak commented Jan 30, 2025

* denotes required fields

Priority*

  • High: This PR needs to be merged first, before other tasks.
  • Medium: This PR should be merged quickly to prevent conflicts due to common changes. (default)
  • Low: This PR does not affect other tasks, so it can be merged later.

Purpose of the PR*

I want to avoid displaying error message of ws from #477 issue

Changes*

I've created func which edit IS_DEV var on dist/background.js file on node process termination, for avoid ws reconnecting after WSS server were stopped because of script interruption

How to check the feature

  1. Run pnpm dev or pnpm dev:firefox
  2. Wait for the end of building process
  3. Interrupt with e.g CTRL + C in terminal

Copy link
Owner

@Jonghakseo Jonghakseo left a comment

Choose a reason for hiding this comment

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

  1. pnpm dev doesn't run because SIGKILL signal is not available on POSIX-compliant (Unix, Linux, macOS)
  2. Websocket server doesn't shut down with pnpm dev process
  3. This solution doesn't seem to work for other content scripts, new-tab, etc. except background.

@PatrykKuniczak PatrykKuniczak force-pushed the fix/ws-reconnect-on-dev-shut-down branch from f9a4262 to 71786fa Compare February 2, 2025 11:59
@PatrykKuniczak
Copy link
Collaborator Author

@Jonghakseo Now it should work everywhere.

I've tested it and it's shutting down with pnpm dev all processes on 8081 are down after i've closed dev

@Jonghakseo
Copy link
Owner

스크린샷 2025-02-16 오후 1 51 56

@Jonghakseo
Copy link
Owner

This appears to be a timing issue. I was wondering if dist/background might not be present when the hmr module is running.

@PatrykKuniczak
Copy link
Collaborator Author

@Jonghakseo I can't reproduce it.
Have you tried pnpm clean:install before?

If yes, then give me steps to reproduce.

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.

Constantly getting error in console WebSocket connection to 'ws://localhost:8081/' failed:
2 participants