Skip to content

[Bug]: Mobile 2.3.0 cannot open any Forgejo pull request from a server with the fast-forward merge method #40472

Closed as not planned

Description

@phorrr

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. Run a T3 Code server that includes fix(forgejo): fast-forward-only repositories can merge pull requests #32738 (0.1.11 here) against a Forgejo-hosted repository. Any Forgejo repository works; its merge-style settings do not matter.
  2. Connect the current store release of the mobile app (iOS 2.3.0).
  3. Open any pull request from that repository.

Expected behavior

The pull request loads. An app that does not know a merge method drops the unknown value, which is what ForwardCompatibleArray in #19899 was added for, and the rest of the view renders.

Actual behavior

The view shows "Couldn't load this pull request" with:

Expected "merge" | "squash" | "rebase" at ["value"]["capabilities"]["mergeMethods"][3]

The header still renders (title, branch, +/- counts, file count), but checks, reviews, description and the merge section never load.

Since #32738 (fix for #32715), the Forgejo provider always advertises mergeMethods: ["merge", "squash", "rebase", "fast-forward"] (ForgejoPullRequestProvider.ts), whatever the repository allows. The store's 2.3.0 build predates #32738, so "fast-forward" at index 3 is unknown to it. The build does include #19899, which should drop that unknown value, but the PR detail RPC response (the ["value"] in the path is the Exit success value) still fails strictly. The tolerant handling does not seem to survive the RPC response decode.

There is no newer store build to update to, and no repository setting avoids it, so every Forgejo pull request is unviewable on mobile with a current server.

Two parts:

  1. Ship a mobile release that includes fix(forgejo): fast-forward-only repositories can merge pull requests #32738.
  2. Find why ForwardCompatibleArray does not protect the RPC response decode. Otherwise the next new enum value breaks the store app the same way.

Related: #19899, #32738, #32715.

Impact

Major degradation or frequent failure

Version or commit

Server 0.1.11; mobile 2.3.0 (iOS, App Store)

Environment

iOS, Forgejo 17.0.1

Logs or stack traces

Expected "merge" | "squash" | "rebase" at ["value"]["capabilities"]["mergeMethods"][3]

Activity

  1. juliusmarminge commented on Nov 21, 2026

    @juliusmarminge
    Member

    I tried to reproduce this on the current build and could not.

    Commit 194025e (origin/main). Not run on a device: that needs the App Store 2.3.0 build plus a Forgejo host, neither available on the VMs. Reproduced at the exact client decode path instead. (1) Scratch vitest in packages/contracts: a struct with mergeMethods: ForwardCompatibleArray(Literals([merge,squash,rebase])) given ['merge','squash','rebase','fast-forward']. Schema.toCodecJson(struct) decodes to ['merge','squash','rebase'], but Schema.toCodecJson(Rpc.exitSchema(Rpc.make('x',{success: struct}))) on {_tag:'Success', value} throws SchemaError 'Expected "merge" | "squash" | "rebase"', the reporter's error under ['value']. (2) Changed the existing 'loads a newer server's detail response' test in packages/contracts/src/pullRequest.test.ts to decode through Rpc.exitSchema(WsRpcGroup.requests.get(WS_METHODS.pullRequestsDetail)) with Schema.toCodecJson, the codec RpcSerialization.layerJson uses. On main it fails with SchemaError 'Expected "merge" | "ready" | ... | "approve-workflows"' on the unknown action 'archive'. Pushed as factory/repro-40472 (5cb20e7).

    Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.

  2. phorrr commented on Nov 21, 2026

    @phorrr
    ContributorAuthor

    Thanks for digging in. I think the close contradicts the findings, though: the repro in factory/repro-40472 (5cb20e7) does reproduce it, and so does the updated detail test on main.

    Root cause, as far as I can tell: ForwardCompatibleArray gets its tolerance from Schema.catchDecoding on each element. For a declaration like Schema.Exit, toCodecJson builds the codec from SchemaAST.toEncoded of each type parameter, which strips those links (internal/schema/toCodec.ts). The wire JSON is therefore checked against a plain literal array before the tolerant decode runs. RpcClient decodes responses with toCodecJson(Rpc.exitSchema(rpc)), so this probably affects every ForwardCompatibleArray field in a request/response RPC, not just merge methods. The existing test only decodes PullRequestDetail directly, so it never covered this path.

    Steps on my side are unchanged: server 0.1.11, App Store mobile 2.3.0, any Forgejo repo, open any PR. Could this be reopened?

  3. drkraft commented on Nov 23, 2026

    @drkraft

    I’m also seeing this on an iPhone with T3 Code 2.3.0 from the public App Store, connected to T3 Code desktop/server 0.1.11 on macOS and a Forgejo repository.

    Opening a pull request shows its header, but the detail view fails with:

    Expected "merge" | "squash" | "rebase"
    at ["value"]["capabilities"]["mergeMethods"][3]
    

    I see that #40490 was merged on November 21. Which iOS release will include the fix? Is there a workaround for the current App Store build?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions