Skip to content

Add path-scoped SignalR cookie repro with React Native client and Node server - #1

Draft
dmitryya-tr with Copilot wants to merge 20 commits into
mainfrom
copilot/create-node-server-react-native-app
Draft

dmitryya-tr with Copilot wants to merge 20 commits into
mainfrom
copilot/create-node-server-react-native-app

Conversation

Copilot AI commented Sep 6, 2026 •

Copy link
Copy Markdown

This repo now reproduces the case where the SignalR endpoint lives under a non-root base path (for example, https://my.domain/my/path) and the server sets two cookies with different path scopes. The React Native app shows which cookies make it through the HTTP priming request, SignalR negotiate request, and WebSocket connection.

  • Node repro server

    • Added a minimal server under SignalRServer/ that exposes:
      • GET /my/path/status for cookie priming/reporting
      • POST /my/path/hub/negotiate for SignalR negotiation
      • GET /my/path/hub?id=... for the WebSocket transport
    • Sets:
      • a root-scoped cookie (Path=/)
      • a second cookie without Path on the priming route so the browser/client derives the path scope from /my/path
    • Returns the observed cookie header in both negotiate and WebSocket flows to make path behavior explicit
    • Avoids mutating cookie state on OPTIONS and hardens malformed WebSocket payload handling
  • React Native repro client

    • Replaced the template screen with a focused repro UI in ReproducerApp/App.tsx
    • Accepts a base URL that already includes the API path
    • Primes cookies with fetch(..., { credentials: 'include' })
    • Connects to SignalR over WebSockets with withCredentials: true
    • Displays the computed /status and /hub URLs plus the server-side request reports
  • Path handling

    • Added small URL helpers so the client consistently derives:
      • <base>/status
      • <base>/hub
    • Covers trailing slash and whitespace normalization without changing the requirement that the base URL already includes the API path
  • Repo cleanup

    • Removed the template cleanup workflow/script so the repo-specific repro files are not overwritten after merge
    • Updated the README to describe the new server/client repro setup

Example of the path-based client configuration:

const connection = new HubConnectionBuilder()
  .withUrl('http://10.0.2.2:3000/my/path/hub', {
    transport: HttpTransportType.WebSockets,
    withCredentials: true,
  })
  .build();
Original prompt

i need node server and react native app that communicate thru signal-r and path of this api is including not only domain but also path https://my.domain -> not ok https://my.domain/my/path ->ok. this open api also needs to set cookies on all the requests one cookie is including path="/" and one does not

Copilot AI and others added 5 commits September 6, 2026 06:53
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Node server and React Native app with SignalR communication Add path-scoped SignalR cookie repro with React Native client and Node server Sep 6, 2026
Copilot AI requested a review from dmitryya-tr September 6, 2026 07:01
Copilot AI and others added 7 commits September 6, 2026 07:10
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Copilot AI and others added 3 commits September 6, 2026 09:14
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Copilot AI and others added 3 commits September 6, 2026 09:18
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
Co-authored-by: dmitryya-tr <65709639+dmitryya-tr@users.noreply.github.com>
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.

2 participants