GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mobile): await branch refs before choosing an automatic feature branch by only21mil · Pull Request #22098 · pingdotgg/t3code

fix(mobile): await branch refs before choosing an automatic feature branch #22098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
maria-rcks merged 5 commits into pingdotgg:main from only21mil:r7/s10-1
Oct 30, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(mobile): await branch refs before choosing an automatic feature branch #22098

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
76874f9
fix(mobile): await branch refs before choosing an automatic feature b…
only21mil Oct 20, 2026
54c1d52
fix(mobile): read branch refs with a finite action query
only21mil Oct 20, 2026
490bec0
fix(mobile): merge main and keep branch refresh regressions focused
maria-rcks Oct 26, 2026
9d5625b
fix(mobile): reuse the finite refs command for branch decisions
maria-rcks Oct 26, 2026
75c7b11
fix(mobile): merge main and preserve fresh branch lookup
maria-rcks Oct 30, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(mobile): read branch refs with a finite action query
Use a one-shot refs query for confirmation instead of waiting for the live
refs cache stream to complete. Cover the stream's waiting result so the
confirmation must continue after fresh refs arrive.

Co-Authored-By: GPT-6.1 Sol <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@only21mil @codex
only21mil and codex committed Oct 20, 2026
commit 54c1d5256496d7c6749cffb6731f36d6c313b8e3

There are no files selected for viewing

32 changes: 26 additions & 6 deletions 32 apps/mobile/src/state/use-selected-thread-git-actions.test.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { VcsListRefsResult } from "@t3tools/contracts";
import { executeAtomQuery } from "@t3tools/client-runtime/state/runtime";
import { resolveAutoFeatureBranchName } from "@t3tools/shared/git";
import * as Effect from "effect/Effect";
import * as Stream from "effect/Stream";
import { AsyncResult, Atom } from "effect/reactivity";
import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";

Expand All @@ -18,7 +19,9 @@ const harness = vi.hoisted(() => ({
renderCount: 0,
onRefreshSettled: () => {},
branchAtom: null as Atom.Atom<AsyncResult.AsyncResult<VcsListRefsResult, unknown>> | null,
refsQueryAtom: null as Atom.Atom<AsyncResult.AsyncResult<VcsListRefsResult, unknown>> | null,
listRefs: vi.fn(),
refsQuery: vi.fn(),
showGitActionResult: vi.fn(),
}));

Expand All @@ -34,6 +37,7 @@ vi.mock("./use-atom-command", () => ({
}));
vi.mock("./vcs", () => ({
vcsEnvironment: { refreshStatus: "refreshStatus", listRefs: harness.listRefs },
vcsRefsQuery: harness.refsQuery,
vcsActionManager: { runStackedAction: () => "runStackedAction", track: vi.fn() },
}));
vi.mock("./threads", () => ({ threadEnvironment: { updateMetadata: "updateMetadata" } }));
Expand Down Expand Up @@ -98,6 +102,7 @@ beforeEach(() => {
harness.renderCount = 0;
harness.onRefreshSettled = () => rerender();
harness.listRefs.mockReset().mockImplementation(() => harness.branchAtom);
harness.refsQuery.mockReset().mockImplementation(() => harness.refsQueryAtom);
harness.showGitActionResult.mockClear();
});

Expand All @@ -121,9 +126,18 @@ describe("useSelectedThreadGitActions", () => {
totalCount: 0,
};
let response = cached ? Promise.resolve(empty) : request.promise;
harness.branchAtom = Atom.make(Effect.tryPromise(() => response)).pipe(Atom.keepAlive);
const fetchRefs = Effect.tryPromise(() => response);
harness.branchAtom = Atom.make(
Stream.concat(Stream.fromEffect(fetchRefs), Stream.never),
).pipe(Atom.keepAlive);
harness.refsQueryAtom = Atom.make(fetchRefs).pipe(Atom.keepAlive);
appAtomRegistry.get(harness.branchAtom);
if (cached) {
await executeAtomQuery(appAtomRegistry, harness.branchAtom);
await vi.waitFor(() =>
expect(appAtomRegistry.get(harness.branchAtom)._tag).toBe("Success"),
);
expect(appAtomRegistry.get(harness.branchAtom).waiting).toBe(true);
await executeAtomQuery(appAtomRegistry, harness.refsQueryAtom);
response = request.promise;
}
root = createRoot(document.createElement("div"));
Expand All @@ -136,10 +150,6 @@ describe("useSelectedThreadGitActions", () => {
});
await flush();
expect(settled).toBe(false);
expect(harness.listRefs).toHaveBeenCalledWith({
environmentId: "environment-1",
input: { cwd: "/repo", limit: 100 },
});
const local = {
name: "feature/update",
isRemote: false,
Expand All @@ -157,7 +167,16 @@ describe("useSelectedThreadGitActions", () => {
hasPrimaryRemote: true,
totalCount: 2,
});
await vi.waitFor(() => expect(settled).toBe(true));
expect(appAtomRegistry.get(harness.branchAtom)).toMatchObject({
_tag: "Success",
waiting: true,
});
const branches = await refresh;
expect(harness.refsQuery).toHaveBeenCalledWith({
environmentId: "environment-1",
input: { cwd: "/repo", limit: 100 },
});
expect(branches).toEqual([local]);
expect(resolveAutoFeatureBranchName(branches!.map((branch) => branch.name))).toBe(
"feature/update-2",
Expand All @@ -174,6 +193,7 @@ describe("useSelectedThreadGitActions", () => {
catch: (error) => error,
}),
);
harness.refsQueryAtom = harness.branchAtom;
root = createRoot(document.createElement("div"));
act(() => root!.render(<Consumer />));
const refresh = actions.refreshSelectedThreadBranches();
Expand Down
4 changes: 2 additions & 2 deletions 4 apps/mobile/src/state/use-selected-thread-git-actions.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { AsyncResult } from "effect/reactivity";

import { useBranches } from "../state/queries";
import { threadEnvironment } from "../state/threads";
import { vcsActionManager, vcsEnvironment } from "../state/vcs";
import { vcsActionManager, vcsEnvironment, vcsRefsQuery } from "../state/vcs";
import { uuidv4 } from "../lib/uuid";
import { appAtomRegistry } from "./atom-registry";
import { readEnvironmentScope, useEnvironmentScope } from "./session";
Expand Down Expand Up @@ -223,7 +223,7 @@ export function useSelectedThreadGitActions() {
if (branchTarget.environmentId === null || branchTarget.cwd === null) return null;
const result = await executeAtomQuery(
appAtomRegistry,
vcsEnvironment.listRefs({
vcsRefsQuery({
environmentId: branchTarget.environmentId,
input: { cwd: branchTarget.cwd, limit: 100 },
}),
Expand Down
8 changes: 8 additions & 0 deletions 8 apps/mobile/src/state/vcs.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ import {
createVcsActionManager,
createVcsEnvironmentAtoms,
} from "@t3tools/client-runtime/state/vcs";
import { createEnvironmentRpcQueryAtomFamily } from "@t3tools/client-runtime/state/runtime";
import { WS_METHODS } from "@t3tools/contracts";

import { connectionAtomRuntime } from "../connection/runtime";

export const vcsEnvironment = createVcsEnvironmentAtoms(connectionAtomRuntime);
export const vcsActionManager = createVcsActionManager(connectionAtomRuntime);

// Action confirmations need a finite request; listRefs stays subscribed for cache updates.
export const vcsRefsQuery = createEnvironmentRpcQueryAtomFamily(connectionAtomRuntime, {
label: "mobile:vcs:refs-query",
tag: WS_METHODS.vcsListRefs,
});
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.