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

Purchases.logIn: log warning if attempting to use a static appUserID #1958

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

NachoSoto
Copy link
Contributor

@NachoSoto NachoSoto commented Sep 29, 2022

This only works in Swift, but it can be useful to catch incorrect usages of logIn, where a user might accidentally pass the api key, or some other key known at compile time.

@NachoSoto NachoSoto added the docs Documentation only changes label Sep 29, 2022
@NachoSoto NachoSoto added the WIP label Oct 14, 2022
@NachoSoto NachoSoto removed the WIP label Oct 14, 2022
@NachoSoto NachoSoto requested a review from a team October 14, 2022 19:01
@NachoSoto NachoSoto marked this pull request as ready for review October 14, 2022 19:01
@NachoSoto NachoSoto merged commit fc9f0da into main Oct 20, 2022
@NachoSoto NachoSoto deleted the log-in-static-string branch October 20, 2022 18:15
NachoSoto pushed a commit that referenced this pull request Oct 26, 2022
**This is an automatic release.**

### Bugfixes
* Fixed Xcode 13.2.x / Swift 5.5 compatibility (#1994) via NachoSoto
(@NachoSoto)
### Other Changes
* Update `fastlane` (#1998) via NachoSoto (@NachoSoto)
* Documentation: fixed missing docs from inherited symbols (#1997) via
NachoSoto (@NachoSoto)
* CI: added job to test compilation with `Xcode 13.2.1` / `Swift 5.5`
(#1990) via NachoSoto (@NachoSoto)
* Extracted `TrialOrIntroPriceEligibilityCheckerType` (#1983) via
NachoSoto (@NachoSoto)
* CI: removed redundant `swiftlint` installation (#1993) via NachoSoto
(@NachoSoto)
* `Nimble`: use a fixed version (#1991) via NachoSoto (@NachoSoto)
* Update fastlane-plugin-revenuecat_internal (#1989) via Cesar de la
Vega (@vegaro)
* `Purchases.logIn`: log warning if attempting to use a static
`appUserID` (#1958) via NachoSoto (@NachoSoto)
* Created `InternalAPI` for "health" request (#1971) via NachoSoto
(@NachoSoto)

Co-authored-by: RCGitBot <dev+RCGitBot@revenuecat.com>
NachoSoto added a commit that referenced this pull request Oct 26, 2022
These became ambiguous after #1958.
NachoSoto added a commit that referenced this pull request Jan 20, 2023
Fixes this warning:

These started happening after #1958. I assumed it was an Xcode bug, because they were showing up on the wrong file.
Turns out that by itself was an Xcode bug (filed as `FB11959877`):

But the underlying warning was correct, which this fixes. We just needed to fix the reference to `logIn` to point to the specific overload.
MarkVillacampa added a commit that referenced this pull request Mar 28, 2023
…rID (#2385)

### Checklist
- [X] If applicable, unit tests
- [X] If applicable, create follow-up issues for `purchases-android` and
hybrids

### Motivation

Hardcoding the user id is not desirable in almost any scenario, so we
want to warn the developer when that happens.

### Description

Following what we did for `Purchases.logIn` in
#1958, detect when
`Builder.with(appUserId:)` is called with a static string and log a
warning.

---------

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation only changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants