Skip to content

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

Merged
NachoSoto merged 4 commits into
mainfrom
log-in-static-string
Oct 20, 2022
Merged

Purchases.logIn: log warning if attempting to use a static appUserID#1958
NachoSoto merged 4 commits into
mainfrom
log-in-static-string

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Sep 29, 2022

Copy link
Copy Markdown
Contributor

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 force-pushed the log-in-static-string branch from 91b8344 to e465d52 Compare October 14, 2022 19:00
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants