Repository navigation
refactor(mobile): share one exact-set check in the Expo config gate - #11196
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change dedupes Assumptions: Files Reviewed (1 file)
Previous Review Summary (commit c94ddb5)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c94ddb5)Status: No Issues Found | Recommendation: Merge Executive SummaryThe Files Reviewed (1 file)
Reviewed by deepseek-flash-latest · Input: 49.2K · Output: 3K · Cached: 219.9K Review guidance: REVIEW.md from base branch |
The shared exact-set check counts members, so a repeated language tag in CFBundleLocalizations would now fail where the previous filter-based test accepted it. Compare the distinct tags, which keeps the assertion about which languages are named rather than how often, and leaves every existing outcome and message unchanged.
Evidence
Evidence: demonstrated — ran
apps/mobile/scripts/assert-expo-config.mjson the merge base and on this branch against the same evaluated config and twelve doctored copies of it; all thirteen runs printed the same message text and the same exit code on both revisions.Change
apps/mobile/scripts/assert-expo-config.mjscompared three collections for exact membership with three unrelated expressions. It now has one local helper besidecheck:All three exact checks call it:
config.platformsArray.isArray(…) && length === … && PLATFORMS.every(includes)Array.isArray(…) && sameMembers(config.platforms, PLATFORMS)android.blockedPermissionsblockedPermissionsMatchwith the same two conditionssameMembers(blockedPermissions, BLOCKED_PERMISSIONS)ios.infoPlist.CFBundleLocalizationsa.length === 0 && b.length === 0sameMembers([...new Set(localizations)], localeTags); the filters now only name the offending tags in the messageThe locale check compares the distinct tags, because the two filters it replaces asked which languages are named rather than how often: a repeated tag names no extra language, and the top-level
localeskeys cannot repeat (Object.fromEntriescollapses them). A repeated tag therefore keeps the outcome it had before, while a dropped, extra, or swapped tag still fails.Not changed:
android.permissionssubset check (missingRequestedPermissions). It asks a different question: plugins add their own permissions, so the evaluated array is never exactly the requested list.CFBundleLocalizationsnon-empty gate above the loop.Verification
apps/mobile/scripts/assert-expo-config.mjsreads the evaluated config fromnpx expo config --json, so the doctored runs replaced that one command with a stub that prints a modified JSON copy of the real evaluated config. Output and exit code were captured for the merge base and for this branch, then compared with Node's runtime warnings removed.Expo config contract OK, identicalplatforms: ["ios"]platforms: ["ios","android","web"]platforms: "ios,android"(not an array)Array.isArrayguard still short-circuitsExpo config contract OK, identicalAll thirteen variants produced byte-identical script output and the same exit code on both revisions; none differed, and the comparison covers every branch of the three changed checks.
The real path also ran on this branch:
oxfmt --list-different scripts/assert-expo-config.mjsreports no difference.apps/mobilelints onlysrc, so the script is outside the lint job, as before.Production prerequisites
None.
Rollout
Build-time guard only; no runtime, schema, secret, or configuration change. The release preflight runs this script as before.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: No new test; keep the differential run as session evidence
Confidence: 0.75 · Precedent: Speed and least work: "do the least amount of work possible, with no drop in quality"; scope: keep each PR diff to files the feature needs. The base-vs-head run on the valid config and the failing configs is the end-to-end proof; put it in the PR.
Answer: Restore exact base parity, dedupe before the check
Confidence: 0.60 · Precedent: Keep the approved scope of a manual work item intact; the brief requires that every assertion outcome and message stay the same, so the refactor must not change behavior.