Skip to content

[canvas-apps][Bug] Coauthoring session dies after ~25-30 min: 410 Gone on diagnosticshub/negotiate, Studio grey screen + MCP "Invalid session state", no auto-recovery #473

Description

Plugin

canvas-apps

Plugin Version

3.0.3

Skill / Command

configure-canvas-mcp, canvas-app (editing via compile_canvas), Canvas Authoring MCP server

Bug Description

After a coauthoring session runs for roughly 25 to 30 minutes, the realtime SignalR channel that Studio and the MCP depend on drops and cannot be re-established. Two things happen at that point:

  1. Power Apps Studio lands on a grey background with the loading dots at the top and never finishes loading. Only a full page reload recovers it.
  2. The Canvas Authoring MCP starts returning HTTP 401 (Unauthorized): Invalid session state on compile_canvas, and every call keeps failing until connect is called again manually.

The trigger is time, not a compile push. It happens while the tab is idle but alive, with no compile_canvas in flight. This is distinct from #240, where the grey screen fires immediately after every push and connect stays valid.

Steps to Reproduce

  1. connect to an existing canvas app and open it in Studio with coauthoring enabled.
  2. Keep the session open and idle (no edits) for ~25 to 30 minutes, tab in the foreground.
  3. Observe the diagnosticshub WebSocket close, then /api/signalr/diagnosticshub/negotiate return 410 Gone on every retry.
  4. Studio shows the grey screen with loading dots and does not recover.
  5. Call compile_canvas from the MCP: it returns HTTP 401 (Unauthorized): Invalid session state.
  6. A full browser reload starts a fresh authoringsession and recovers Studio. The cycle repeats ~25 to 30 minutes later.

Expected Behavior

The root issue (410 on the Island gateway negotiate) looks like a Power Apps service or gateway issue, so it may need routing to the Power Apps product team. For this repo specifically:

  1. The Canvas Authoring MCP should detect coauthoring session death and re-establish the session automatically (re-negotiate or re-connect), rather than surfacing Invalid session state and requiring a manual connect on every failure. If auto-recovery is not possible, the error should say the session expired and that a Studio reload plus reconnect is required.
  2. The configure-canvas-mcp skill documentation should note the observed ~25 to 30 minute coauthoring session lifetime and the recovery path: reload the Studio tab to start a fresh authoringsession, then re-run compile_canvas to re-push from the local .pa.yaml files.

Actual Behavior

Power Apps Studio stays on a blank grey screen with the familiar canvas apps loading dots moving across the top of the screen. Changes that were made by the MCP were not visible on the screen, and it's hard to tell whether they survived even after refreshing the browser.

Relevant Logs / Screenshots

Captured from a full HAR network trace of a coauthoring session (browser was a Chromium-based browser on Windows 11).

- The realtime channel is `/api/signalr/diagnosticshub` on the Island authoring gateway (`authoring.<region>-il104.gateway.prod.island.powerapps.com`, path segment `v3.26082.7.378933809`).
- On session start the diagnosticshub WebSocket connects normally (HTTP 101/200) and stays open.
- After ~25 to 32 minutes the WebSocket closes. The client then tries to re-negotiate, and every `/api/signalr/diagnosticshub/negotiate` returns **410 Gone** with an empty body (`content-type: text/plain`).
- The client retries the negotiate roughly every 6 to 12 seconds. Every retry is 410. It never recovers, and Studio stays on the grey screen.
- The negotiate carries a sticky-session token (`x-ms-session-state`) and an `access_token_override` JWT (redacted). The JWT `exp` was about 83 minutes out and still valid at the moment of the 410, so this is not token expiry. The 410 points to the pinned gateway session or route being gone.
- The tab was active during the idle window, not asleep. Telemetry to `noam.events.data.microsoft.com` and polling to `<env>.environment.api.powerplatform.com` kept flowing throughout, so this is not a sleep or wake event.

This reproduced twice in one trace:

| | Session 1 | Session 2 |
|---|---|---|
| `authoringsession/start` | 17:28:00 UTC | 18:12:50 UTC |
| diagnosticshub WebSocket open | 17:28:05 | 18:12:55 |
| WebSocket stayed open for | ~31.7 min | ~25.6 min |
| `negotiate` returns 410 Gone (x4, retrying) | 17:59:45 to 18:00:09 | 18:38:33 to 18:38:58 |
| Outcome | grey screen | grey screen |

Correlation identifiers (from 2026-08-26 UTC):
- client-session-id: `d3ac1cdd-d7a6-4b35-9929-f35fd5a8ee75`
- MCP compile_canvas 401 SessionId: `aef9667d-afe4-4097-82ec-0c6f756206b0`

Environment

  • OS: Windows 11
  • Browser: Chromium-based (Microsoft Edge)
  • Plugin: canvas-apps 3.0.3
  • Canvas Authoring MCP server (.NET 10)
  • App: solution-based canvas app, SharePoint data via environment variables of type Data source

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions