Skip notification permission prompt for screenshot runs#13
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01a022813a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| export function readEnvFlag(name: string) { | ||
| return envFlagEnabled(process.env[name]); |
There was a problem hiding this comment.
Read Expo public env var with static property access
readEnvFlag uses process.env[name], but shouldSkipNotificationPermissionPrompt depends on this value to bypass requestPermissionsAsync; in Expo bundles, EXPO_PUBLIC_* values are only injected for direct/static process.env.EXPO_PUBLIC_... accesses, so this computed lookup resolves to undefined at runtime and the skip flag never takes effect during screenshot automation.
Useful? React with 👍 / 👎.
Motivation
Description
EXPO_PUBLIC_SKIP_NOTIFICATION_PERMISSION_PROMPTand a helper to read it fromprocess.envinapps/mobile/src/utils/env.ts.apps/mobile/src/services/notifications.tsto exposeshouldSkipNotificationPermissionPrompt()and return early fromensureNotificationPermissionAsync()when the flag is enabled so the app does not request permissions during runs that set the flag.apps/mobile/tests/notifications-permission.test.tscoveringenvFlagEnabledtrue-like and false-like values.Testing
pnpm -C apps/mobile test notifications-permission, and the tests passed (2 tests, 2 passed).pnpm -C apps/mobile lint, and lint completed with no issues.EXPO_PUBLIC_SKIP_NOTIFICATION_PERMISSION_PROMPT=trueduring screenshot runs.Codex Task