Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] Fix permission issue when user doesn't have permission to view app #25650

Merged
merged 1 commit into from Dec 1, 2023

Conversation

wschurman
Copy link
Member

Why

When #21989 was written, it forgot to account for cases where the app isn't visible to the viewer (happens when app privacy is set to private). It had incorrectly assumed that all app privacy delegated to the viewer's permissions on the owning account.

Closes ENG-10719.

How

The fix is to treat errors thrown when trying to query an app as permission errors and return null for fetchAndCacheNewDevelopmentCodeSigningInfoAsync. Note that this does mask network errors, I think this is ignored when offline anyways.

Test Plan

Run new tests.

Manual test plan:

  1. Log in to account that doesn't have permission on NCL
  2. Build Expo Go locally
  3. Build CLI locally
  4. nexpo start
  5. Load NCL before change, see error about Account entity not being visible.
  6. Load NCL after change, see it works and is unsigned.

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Nov 29, 2023
@wschurman
Copy link
Member Author

Ping. This is a release blocker.

@wschurman wschurman requested a review from ide December 1, 2023 06:44
Copy link
Member

@ide ide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock the release but I think there is a chance we'll want to revisit this and make the error checking even more precise, specifically by checking the GraphQL error for a specific error code (and doing similar for CombinedErrors if there is just one underlying error and it's a GraphQL error that matches)

@wschurman
Copy link
Member Author

Approving to unblock the release but I think there is a chance we'll want to revisit this and make the error checking even more precise, specifically by checking the GraphQL error for a specific error code (and doing similar for CombinedErrors if there is just one underlying error and it's a GraphQL error that matches)

I thought about it, but there isn't a callsite in this codebase that does it with Graphql errors (only ApiV2Error and only for OTP).

@wschurman wschurman force-pushed the @wschurman/fix-permission-issue branch from 35f51a5 to 4447ed1 Compare December 1, 2023 16:15
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Dec 1, 2023
@wschurman wschurman force-pushed the @wschurman/fix-permission-issue branch from 0efaa64 to 25fdcc8 Compare December 1, 2023 16:17
@wschurman wschurman merged commit 744b058 into main Dec 1, 2023
5 of 7 checks passed
@wschurman wschurman deleted the @wschurman/fix-permission-issue branch December 1, 2023 16:19
onizam95 pushed a commit to onizam95/expo-av-drm that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants