Skip to content

WizSite app: a first sign-in with no installation leads to installing OpenWiz Viewer #1325

Closed
openwizdev/WizSite
#28

Description

@jparker2006

Parent

A bug found in the owner's first sign-in on openwiz.dev/app (2026-11-19), routed to spec #1223's fleet. Fixes AP5's (#1258) empty state. The pull request lives in openwizdev/WizSite. AP8 (#1261) merges only after this does.

What to build

A first-time user who signs in can actually reach their repositories. Signing in authorizes the OpenWiz Viewer App but doesn't install it, so the repository picker is empty, and its "Choose repositories on GitHub" link opens GitHub's installations settings, which are also empty for a new user. Instead:

  1. The link goes to https://github.com/apps/openwiz-viewer/installations/new.
  2. When a signed-in user has no installations, the page says it plainly ("One more step: let OpenWiz Viewer read your repositories"), with that as the main button rather than a small link. After installing, the user lands back in the app and sees the picker filled.
  3. Check whether the Viewer App's "Request user authorization (OAuth) during installation" setting could make first sign-in one step, and record the finding on this ticket. Changing the App's settings is the owner's call.

Owned paths

  • app/shell.js in openwizdev/WizSite (shared: the repository picker's empty state and its link)
  • the app's checks for this case under scripts/ in openwizdev/WizSite (shared: those cases)

Relies on: nothing

Links

none

Acceptance criteria

  • A signed-in user with zero installations sees the one-more-step message with the install button, linked to apps/openwiz-viewer/installations/new; checked against a recorded GitHub answer, red first
  • A user with installations still sees the picker as before
  • The OAuth-during-installation finding is recorded on this ticket
  • Jake's chosen look (AP5) is unchanged apart from this state
  • Test rule (The test rule: what earns a test, and what never does #687): every new test protects a supported behaviour, a contract others rely on or a safety invariant, and the pull request says per test catches: <the bug>, or no new test: <why>. No mock-returns-stub, source mirroring, compiler re-checks, quota tests or unreachable cases; a bug gets a failing test first.

Proof

The app check for the zero-installation case, red then green, and the preview's empty state.

Builder Claude Code Opus 5.5 Medium and reviewer Codex Sol 6.2 Medium, other family, no helper agents, on the cross-repository route.

Activity

  1. added
    bug
    ready-for-agent
    on Nov 19, 2026
  2. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    Approved on its own by the orchestrator, 2026-11-19: fix the empty Viewer installation path before AP8 merges. Routed to the #1223 fleet.
    Private record: https://github.com/jparker2006/ClosedWiz/issues/3065#issuecomment-7004619748

  3. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: start checked, branch room/1325-install-viewer

  4. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    Finding: "Request user authorization (OAuth) during installation" would not make first sign-in one step in this app (builder, 2026-11-19, from GitHub's official docs; no App setting was read or changed, no live credentials used)

    What GitHub documents:

    • With the setting on, after a user installs, GitHub redirects to https://github.com/login/oauth/authorize?client_id=CLIENT_ID and then to the first callback URL with a code (Generating a user access token for a GitHub App). The documented redirect carries only client_id, not a state the app chose.
    • With the setting on, the Setup URL can't be set; users go to the callback URL instead (Registering a GitHub App, step 13).
    • An installation URL can carry ?state=… to return people to that state after they install or authenticate (Sharing your GitHub App), but the setup URL's installation_id must not be trusted on its own (About the setup URL).

    What that means for AP3's state-bearing sign-in (functions/api/sign-in/[step].js, app/shell.js boot):

    • Every code the app accepts must carry the state that /api/sign-in/start minted and bound to its own host-only cookie; /api/sign-in/token refuses a code without that cookie, and the app only finishes sign-in when both code and state are present. An install started from github.com/apps/openwiz-viewer/installations/new never passes through /start, so the install-time code would arrive with no helper state and would be dropped: the user would still have to press Sign in, i.e. still two steps.
    • Making it one step would mean either accepting codes without the helper's state (loses AP3's forgery protection; GitHub calls state "strongly recommended") or a new start route that mints the state, sets the cookie and sends the user to the installation URL with ?state=, relying on GitHub passing it through the install-then-authorize redirect, which the docs above don't state explicitly. That is a helper and App-setting change, outside this ticket and the owner's call.
    • Turning it on also removes the Setup URL that brings an installer back to /app today (the manifest sets request_oauth_on_install: false, setup_url: https://openwiz.dev/app).

    Recommendation: leave the setting off. The PR ships the safe two-step path: sign in, then the direct install button, and GitHub's setup URL returns the user to the filled picker. A one-step flow would be a separate ticket with its own live check of the state pass-through.

  5. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    Builder status (edited in place)

  6. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    The minimum supporting edit to app/data.js is granted for R1: pass the existing installation result through to the picker. No other change to app/data.js. Ruling: https://github.com/jparker2006/ClosedWiz/issues/3065#issuecomment-7005182866 (part 1).

  7. jparker2006 commented on Nov 19, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: cross-repository merge verified in openwizdev/WizSite#28 at approved head 68458cc56e66554aac0452f165809bf60585ea2f. Merge commit 9941baef059f804ad61b25180441649fcf499830.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions