Repository navigation
fix(settings): accept union-valued permission targets without mode - #5075
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
|
Reviewed 29fb4b9. The union-valued permission call is fixed, but the widened options type breaks narrowing for existing TypeScript callers. In packages/contracts/src/client-settings.ts#L101 (https://github.com/callstack/agent-device/blob/29fb4b9/packages/contracts/src/client-settings.ts#L101), the new mode-free arm also contains photos. After The rule the type must satisfy: every arm of The code has no other problems. Two Body rules jobs show as cancelled, not failed. The diff changes a contracts type and its test, so it does not touch PR-body validation, and the other 21 checks pass. Those two jobs need a re-run before merge. No conflicts. Not verified here: tsc and vitest were not run locally, and the findings rest on static assignability reasoning plus the failing-at-base and passing-at-head run reported in the PR body. |
|
Fixed in |
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The earlier findings from 29fb4b9 (#5075 (comment)) are fixed at 1cbe1ea, and no new problems were found in the diff. All checks pass at this commit, including Body rules, which passed after the earlier cancellation. The only skipped item is the non-required Proof check, and there are no conflicts. The change is type-only, so CI's Lint, Typecheck & Package job is the main coverage for it. Not verified here: the repo's tsconfig and the full vitest typecheck were not run locally. The contracts and kernel type sources were compiled in isolation with strict tsc, and the |
Summary
Restore mode-free
settings.updatecalls with union-valued permissions, fixing the downstream E2E build after #5026. A separate call overload accepts the union. The exportedSettingsUpdateOptionspreserves photos narrowing. Six files cover SDK types and tests. Runtime behavior is unchanged.Before / after
At base, the call fails typecheck. At head, it compiles without a cast. Adding an explicit mode to the union still fails. A photos-specific handler still accepts a
SettingsUpdateOptionsvalue guarded bypermission === 'photos'.Validation
8a29aea9a820. The original union-call regression failed there. The new narrowing regression fails on29fb4b9.1cbe1eaeb6fa3ea90a95a7e6836b935739638192. TypeScript build and all 59 focused tests passed.pnpm check:affected --run --head HEADpassed at the exact commit (receiptrun-q29RJ2). Hosted CI covers the remaining lanes.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.