socketio / socketio/socket.io

inter-server comm not really a replacement to customHook / customRequest

Open
#3,941 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

customRequest / customHook were triggered for all servers (including current node).

serverSideEmit only works for "other" nodes.

        if (request.uid === this.uid) {
          debug("ignore same uid");
          return;
        }

Of course - we can execute method locally using js function, but if we want to combine answers from other nodes + current node - that requires some additional logic.

Probably worth adding a switch that would allow emiting to local node as well and collect it's result in same manner as remote ones?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing serverSideEmit and the same-uid guard shown in the issue. Determine how optional local execution should combine with remote responses, then define completion around the switch behavior and aggregated result; the payload names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.