Skip to content

Clean up: moved obsoleted methods to a separate file#950

Merged
NachoSoto merged 2 commits into
RevenueCat:mainfrom
NachoSoto:deprecations
Nov 18, 2021
Merged

Clean up: moved obsoleted methods to a separate file#950
NachoSoto merged 2 commits into
RevenueCat:mainfrom
NachoSoto:deprecations

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Nov 16, 2021

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread Purchases/Misc/Deprecations.swift Outdated
Comment thread Purchases/Misc/Deprecations.swift Outdated
Comment thread Purchases/Public/Purchases.swift Outdated
Comment thread Purchases/Misc/Deprecations.swift Outdated
Comment thread Purchases/Misc/Deprecations.swift Outdated
Comment thread Purchases/Misc/Deprecations.swift Outdated
@NachoSoto NachoSoto changed the title Clean up: moved deprecations to a separate file Clean up: moved obsoleted methods to a separate file Nov 16, 2021
@NachoSoto

NachoSoto commented Nov 16, 2021

Copy link
Copy Markdown
Contributor Author

Thanks for the review @aboedo. I addressed all your comments and now we only have Obsoletions.swift with only the methods that aren't callable 👍

@NachoSoto NachoSoto force-pushed the deprecations branch 2 times, most recently from aee9dbd to 436c0e4 Compare November 17, 2021 01:06

@aboedo aboedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks great! Thanks for taking care of this!

Comment thread Purchases/Misc/Obsoletions.swift Outdated
Comment on lines 21 to 26

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it looks like these comment blocks are redundant now, could you remove them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They're public methods. We could disable the lint rule for this file I guess though. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ohhh I see, that makes sense.

Perhaps we could keep the old docs with a note explaining how they've been renamed?
I'm thinking about the case where someone updates to RCv4, then Xcode tells them to update the method names and they might not be sure what the methods did in the first place. If they have the old docs in place with a note, it'll be clear, but otherwise they'll just run into a deprecated method that doesn't provide much context.

What do you think?

If you did decide to add the old docs, it can be done in a separate PR so as not to hold this one.

So feel free to either keep this or disable the rule for this file for now, merge when ready, and we can continue the discussion about the docstrings in a follow-up PR. Here are the old docs for reference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks yeah that's definitely the right thing to do! I just added those.

@NachoSoto NachoSoto force-pushed the deprecations branch 2 times, most recently from 9af98af to 7b3fd63 Compare November 17, 2021 22:25

@aboedo aboedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great!! 🎈

@NachoSoto NachoSoto merged commit 6506684 into RevenueCat:main Nov 18, 2021
@NachoSoto NachoSoto deleted the deprecations branch November 18, 2021 16:20
NachoSoto added a commit to NachoSoto/purchases-ios that referenced this pull request Nov 29, 2021
…yManager implementation

Fixes RevenueCat#732. Instead of worrying about whether `IdentityManager.configure` was idempotent or if the implementation was correct, I realized that `Purchases` never called that method after its initialization
Therefore, to simplify the whole implementation, the `configure` part is now in the constructor. Subsequent `logIn`/`logOut` calls are the only way to change the identity.

Some of this code was tangled with some of the deprecations in `IdentityManager`, so to aid in this refactor, I `obsoleted` [3 methods that were already `deprecated` in version 3.13.0](https://github.com/RevenueCat/purchases-ios/blob/3.13.0/Purchases/Public/RCPurchases.h#L205-L224).

This allowed me to remove the associated tests instead of changing them to use the new API. Following RevenueCat#950, these methods are now separate in `Obsoletions.swift`, and they point to the new methods.

The remaining tests in `PurchasesTests` all pass, and the ones in `IdentityManagerTests` have been converted to initializing new `IdentityManager` instances. Those pass as well, so I feel confident in this refactor 💪
taquitos pushed a commit that referenced this pull request Nov 30, 2021
… `IdentityManager` implementation (#974)

* Obsoleted Purchases.createAlias/identify/reset and simplified IdentityManager implementation

Fixes #732. Instead of worrying about whether `IdentityManager.configure` was idempotent or if the implementation was correct, I realized that `Purchases` never called that method after its initialization
Therefore, to simplify the whole implementation, the `configure` part is now in the constructor. Subsequent `logIn`/`logOut` calls are the only way to change the identity.

Some of this code was tangled with some of the deprecations in `IdentityManager`, so to aid in this refactor, I `obsoleted` [3 methods that were already `deprecated` in version 3.13.0](https://github.com/RevenueCat/purchases-ios/blob/3.13.0/Purchases/Public/RCPurchases.h#L205-L224).

This allowed me to remove the associated tests instead of changing them to use the new API. Following #950, these methods are now separate in `Obsoletions.swift`, and they point to the new methods.

The remaining tests in `PurchasesTests` all pass, and the ones in `IdentityManagerTests` have been converted to initializing new `IdentityManager` instances. Those pass as well, so I feel confident in this refactor 💪

* SwiftAPITester: removed calls to deprecated methods

* ObjCAPITester: removed calls to deprecated methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants