You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Mobile 2.3.0 cannot open any Forgejo pull request from a server with the fast-forward merge method #40472
Connect the current store release of the mobile app (iOS 2.3.0).
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.
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.
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?
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?
Activity
juliusmarminge commentedon Nov 21, 2026
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.
phorrr commentedon Nov 21, 2026
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 onmain.Root cause, as far as I can tell:
ForwardCompatibleArraygets its tolerance fromSchema.catchDecodingon each element. For a declaration likeSchema.Exit,toCodecJsonbuilds the codec fromSchemaAST.toEncodedof 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.RpcClientdecodes responses withtoCodecJson(Rpc.exitSchema(rpc)), so this probably affects everyForwardCompatibleArrayfield in a request/response RPC, not just merge methods. The existing test only decodesPullRequestDetaildirectly, 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?
drkraft commentedon Nov 23, 2026
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:
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?