Repository navigation
Launcher: DeviceStore owns devices, teams, the install target and the shell copy flow (#387) - #471
Merged
Conversation
3 of 4 tasks
v0lumehi
force-pushed
the
v0lumehi/device-store
branch
from
November 2, 2026 12:47
44edbed to
cde6b89
Compare
…a DeviceStore (#387) DeviceStore (NXModel) owns the paired devices, the signing teams, the chosen device and team and the copy flow of the shared app. DeviceTools, AppSignature, DeviceControl and ShellInstaller start their tools through ProcessRunner, which got a timeout, an input and one primitive, streamLines. xcrunPath and volumesRoot are injected through BuildModel.init. Behavior does not change.
v0lumehi
force-pushed
the
v0lumehi/device-store
branch
from
November 2, 2026 16:00
9b44cd1 to
348040f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #469 (stack #459), retarget to main after the ones below merge.
Part of #387, step 7 (devices).
Fix or feature
Not from outside. A maintainer step of the plan in #387.
What and why
BuildModelstill owned the paired devices, the signing teams, the install target and the copy flow of the shared app. This PR moves them intoDeviceStoreinNXModel, asAppUpdateStore,RepoStore,EngineSyncStoreandDependencyStoredid. Behavior does not change.What moved into
DeviceStore(126 lines):checked, andrefresh()(devicectl and the keychain, off the main actor, returns theTask)shellCopy,answerCopy), the wait for a cable (shellWaiting,cancelWait), and the blocking bridge the install calls from its queue (askCopy,setWaiting,waitCancelled)xcrunas an injected value, and the two listings as closures with the real ones as defaultWhat moved into
NXCore:ShellCopyPlan,ShellCopyDecisionandShellConnection(ShellInstall.Connectionstays as an alias),DeviceControl(devicectl for the save transfer) andLockedFlagProcesses.
DeviceTools.run,DeviceControl,AppSignatureandShellInstaller.runwere directProcessusers. They start their tools throughProcessRunnernow. I extended the runner, with a fake and tests:ProcessLaunch.timeoutends a captured run that outlasts it (SIGTERM, SIGKILL 2 s later) andProcessResult.timedOutsays soProcessLaunch.inputis written to standard input of a captured runstreamLines: merged output as whole lines (empty ones too, a last line without a newline included), a callback when the process has started (Stop reads it), an optional process group thatProcessGroupstracksThe loose test hooks are gone.
BuildModel.xcrunPathandvolumesRootarelets thatBuildModel.init(xcrun:volumesRoot:)takes, and the store getsxcrunfrom it.teamsProviderisDeviceStore.readTeams.volumesRootis read by the failure classifier and not by a device tool, so it stays on the model.Views: the Builds page's install target and the copy card observe
DeviceStore.What stays in
BuildModeland goes to the build store, because it belongs to the build run:installedOnandinstalledAppPath,installsDirectly(reads the build target),shellRetryand the retry of the game data,installShell(feeds the build's stages and failure), the reinstall, the re-sign andopenOnDevice.installDevice,signingTeamanddeviceName(_:)are forwarders to the store, because the build code reads them. This is infrontend/ARCHITECTURE.mdtoo.SourceSizeTests:ContentView.swiftwent from 2073 to 2049 lines, its limit is lowered.Checked
cd frontend && swift testthree times, all green. 846 tests in total (NXModelTests 96, NXCoreTests 113, NX2AppleTests 637 with 17 skipped), the step before had 816. No test failed in any run. The frontend-qt tests pass (214, 14 skipped).DeviceStoreTests(15, without SwiftUI),DeviceToolsRunnerTests(9, a fake runner, plus one real run against a stand-inxcrunthat hangs),ProcessRunnerTests(6 more: timeout, input, whole lines, status, group).ShellInstallTests, which runShellInstallerand the model against a stand-inxcrunthrough the real runner.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository