Repository navigation
fix(settings): keep the --app hint on the daemon route and type mode for photos only - #5026
Conversation
…aemon route Positionals sent straight to the daemon, such as permission deny notifications com.example.app, came back with only the code and message, so the caller lost setting_permission_app_positional and the --app hint that the CLI route shows. Normalize the AppError the way other daemon handlers do.
SettingsUpdateOptions accepted mode for every permission target, so { permission: 'camera', mode: 'limited' } compiled and failed at runtime. Read the moded targets from the catalog forms and refuse mode for the rest.
…nly the status bar
|
Thanks for the fix. The PR is ready at e15ede0: the --app hint stays on the daemon route and mode is accepted for photos only, and no problems were found. Not blocking: the iOS-simulator wifi/airplane help sentence and the app-settings test tweak are a separate change from this issue, and settings parse refusals other than the permission case now also carry the INVALID_ARGS hint and retriable flag, so one sentence in the PR body would cover that; both can be taken or left. CI shows no failures: the two non-passing Body rules checks were cancelled rather than failed, probably by PR body edits, and the other 15 checks pass, including typecheck. The Body rules checks need a re-run to go green before merge. Not verified here: tests were not run locally, and no live device run was done, which this change does not need because the refusal happens before any device dispatch. There are no conflicts. |
Summary
Follow-up to #5006 and #5019.
--appguidance.parseSettingsArgsreturned only the code and message, so a caller sending positionals straight to the daemon lostsetting_permission_app_positionaland the--apphint. It now normalizes theAppErrorlike other daemon handlers, matching the CLI route.SettingsUpdateOptionstakesmodeonly withphotos. The targets that take a mode are read from the catalog forms; every other target typesmode?: never, so{ permission: 'camera', mode: 'limited' }fails to compile instead of at runtime. A caller that forwards a widePermissionTargettogether with a mode must now narrow it to'photos'before passing the mode.settingshelp says iOS simulatorwifiandairplanechange only the status bar.Before / after
parseSettingsArgswith['permission', 'deny', 'notifications', 'com.example.app']:tsconconst o: SettingsUpdateOptions = { setting: 'permission', state: 'grant', permission: 'camera', mode: 'limited' }:Validation
unit-coreruns: the four touched settings test files (87 tests) and the command-doc guards (77 tests) passed.generate:command-docsreportscommands.mdis current.aecafaf30, heade15ede08b.pnpm check:affected --run --head e15ede08b: format, lint, typecheck, layering, fallow, build, package, integration-node, and vitest-related passed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.