Skip to content

Fix the VS Code extension getting 401 from the Sync API #718

Closed

Description

@JSdotNet

The VS Code extension calls the sync inbox endpoint with no bearer token, but every inbox route now requires a paired device. Every call the extension makes is answered 401, so the extension can only ever show "cloud sync unavailable". Found in the 2026-09-27 repository review.

Context

src/App/Backlog.Ide.VsCode/src/extension.ts lines 42 and 73 call fetch(${url}/api/sync/inbox) with no Authorization header and no device-pairing flow. src/Modules/Sync/Backlog.Modules.Sync.Api/Endpoints/InboxEndpoints.cs line 29 maps the inbox group with .RequireAuthorization(SyncPolicies.PairedDevice), and Security/SyncAuthenticationExtensions.cs line 55 makes that policy the fallback. The doc comment at InboxEndpoints.cs line 15 still says "the editor extension" calls these routes.

Decide one of two outcomes and implement it:

  1. Give the extension the same device flow the mobile client has: register via /devices/register, exchange the pairing code via /devices/token, persist the credential in the extension's secret storage, and send Authorization: Bearer on every inbox call. Handle 401 by prompting to re-pair.
  2. Park the extension: make its command report that it is not yet paired-device aware, and remove the "editor extension" claim from the endpoint doc comment so the API documentation stops promising a client that cannot connect.

Either way, add a test in src/App/Backlog.Ide.VsCode (or a note in its README if the extension has no test harness) that pins the chosen behaviour. Route through delivery:flow-code per CLAUDE.md.

Activity

  1. JSdotNet commented on Sep 27, 2026

    @JSdotNet
    OwnerAuthor

    The issue sweep needs one answer before this can be fixed:

    • Which outcome do you want: give the extension the full device-pairing flow (option 1), or park it with a not-yet-paired message (option 2)?
  2. added
    triagedClassified by the issue sweep
    needs-infoThe issue sweep asked the reporter for what a fix needs
    on Sep 27, 2026
  3. added
    in-progressA worker session is actively working this issue
    on Oct 15, 2026
  4. self-assigned this
    on Oct 15, 2026
  5. JSdotNet commented on Oct 15, 2026

    @JSdotNet
    OwnerAuthor

    The issue sweep (2026-10-15) opened draft pull request #1290. Told to decide without waiting, it took option 1 (the extension pairs by redeeming a desktop pairing code, not by /devices/register, which would mint a separate empty owner); the pull request names option 2 and what following it would change.

  6. removed
    in-progressA worker session is actively working this issue
    on Oct 15, 2026
  7. JSdotNet commented on Oct 17, 2026

    @JSdotNet
    OwnerAuthor

    Closed by the issue sweep as already fixed: PR #1290 (merge 218a4b4, on main) pairs the VS Code extension through src/App/Backlog.Ide.VsCode/src/sync-client.ts so inbox calls carry a bearer token, pinned by sync-client.test.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds-infoThe issue sweep asked the reporter for what a fix needstriagedClassified by the issue sweep

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions