microsoft / microsoft/vs-streamjsonrpc

Events raised by client proxy should set `sender` to proxy rather than JsonRpc object

Open
#755 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking change bug
Dominant language
C#
Stars
937
Forks
178
Avg merge
3d 1h
Merged PRs (30d)
28

Description

The dynamic proxies generated on the client raise events with sender set to this.rpc (the JsonRpc object behind the proxy). For a proxy holder, particularly one that has never seen the JsonRpc object because it was created by another party, this may be unexpected.

I think the proxy sending this as the sender parameter is more appropriate so that someone's event handler can find the object on which the handler was added via the sender argument.

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 in src/StreamJsonRpc/ProxyGeneration.cs around line 765, where dynamically generated client proxies raise events and pass this.rpc as sender. Trace the event-raising path and verify that handlers receive the proxy instance as sender, including proxies whose JsonRpc object was created elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.