Skip to content

PurchaseTesterSwiftUI: added new window on Mac to manage proxy#2518

Merged
NachoSoto merged 2 commits into
mainfrom
purcahse-tester-proxy-ui
May 22, 2023
Merged

PurchaseTesterSwiftUI: added new window on Mac to manage proxy#2518
NachoSoto merged 2 commits into
mainfrom
purcahse-tester-proxy-ui

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

This allows managing the proxy at runtime through the UI:
Screenshot 2023-05-19 at 2 07 18 PM

See also https://github.com/RevenueCat/khepri-mitm-proxy/pull/6

@NachoSoto NachoSoto added the test label May 19, 2023
@NachoSoto NachoSoto requested a review from a team May 19, 2023 21:07
@codecov

codecov Bot commented May 19, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2518 (0cafcc0) into main (24b630a) will decrease coverage by 0.04%.
The diff coverage is n/a.

❗ Current head 0cafcc0 differs from pull request most recent head 1930544. Consider uploading reports for the commit 1930544 to get more accurate results

@@            Coverage Diff             @@
##             main    #2518      +/-   ##
==========================================
- Coverage   87.87%   87.83%   -0.04%     
==========================================
  Files         199      199              
  Lines       13721    13655      -66     
==========================================
- Hits        12057    11994      -63     
+ Misses       1664     1661       -3     

see 7 files with indirect coverage changes

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some comments, but I don't think they are blockers

Comment thread Tests/TestingApps/PurchaseTesterSwiftUI/Shared/Proxy/ProxyManager.swift Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm wondering, should this button also exist in the configuration screen? In case we want to switch the proxy mode before we configure the SDK.

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.

Yeah good point! Once you open the window it remembers it and stays open every time you open the app, but technically there's no way to open it on first launch, so I'll do that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm so the app will remember the proxy mode across launches? I would have guessed it should just use the /status endpoint to get the current mode and use that... I think modifying the proxy mode on app launch can be confusing IMO. Maybe I understood you incorrectly though.

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.

Hmm so the app will remember the proxy mode across launches?

No it doesn't, it'll refetch it. It just remembers that the window was open.

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.

I'm wondering, should this button also exist in the configuration screen? In case we want to switch the proxy mode before we configure the SDK.

This is a bit of extra work so I'll punt for now. You can still open the window, then click "reconfigure" to change the mode before starting the SDK.

@NachoSoto NachoSoto force-pushed the purcahse-tester-proxy-ui branch from 0cafcc0 to 1930544 Compare May 22, 2023 18:44
@NachoSoto NachoSoto enabled auto-merge (squash) May 22, 2023 18:44
@NachoSoto NachoSoto merged commit 1f9265a into main May 22, 2023
@NachoSoto NachoSoto deleted the purcahse-tester-proxy-ui branch May 22, 2023 19:04
NachoSoto added a commit that referenced this pull request May 23, 2023
Follow up to #2518.
Also fixed the `CustomerInfo` `Picker`, which wasn't working on iOS due to its design.
NachoSoto added a commit that referenced this pull request May 24, 2023
Follow up to #2518.

Also fixed the `CustomerInfo` `Picker`, which wasn't working on iOS due
to its design.
This was referenced May 31, 2023
@NachoSoto NachoSoto mentioned this pull request May 31, 2023
NachoSoto added a commit that referenced this pull request Jun 1, 2023
**This is an automatic release.**

### New Features
* `Offline Entitlements`: use offline-computed `CustomerInfo` when
server is down (#2368) via NachoSoto (@NachoSoto)

### Bugfixes
* `AppleReceipt.debugDescription`: don't pretty-print JSON (#2564) via
NachoSoto (@NachoSoto)
* `SK2StoreProduct`: fix crash on iOS 12 (#2565) via NachoSoto
(@NachoSoto)
* `GetCustomerInfo` posts receipts if there are pending transactions
(#2533) via NachoSoto (@NachoSoto)
### Performance Improvements
* `PurchasedProductsFetcher`: cache current entitlements (#2507) via
NachoSoto (@NachoSoto)
* Performance: new check to ensure serialization / deserialization is
done from background thread (#2496) via NachoSoto (@NachoSoto)
### Dependency Updates
* Bump fastlane from 2.212.2 to 2.213.0 (#2544) via dependabot[bot]
(@dependabot[bot])
### Other Changes
* `CustomerInfoManager`: post all unfinished transactions (#2563) via
NachoSoto (@NachoSoto)
* `PostReceiptOperation`: added ability to also post `AdServices` token
(#2566) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: improved computation log (#2562) via NachoSoto
(@NachoSoto)
* Added `TransactionPoster` tests (#2557) via NachoSoto (@NachoSoto)
* Refactored `TransactionPoster`: removed 2 dependencies and abstracted
parameters (#2542) via NachoSoto (@NachoSoto)
* `CustomerInfoManagerTests`: wait for `getAndCacheCustomerInfo` to
finish (#2555) via NachoSoto (@NachoSoto)
* `StoreTransaction`: implemented `description` (#2556) via NachoSoto
(@NachoSoto)
* `Backend.ResponseHandler` is now `@Sendable` (#2541) via NachoSoto
(@NachoSoto)
* Extracted `TransactionPoster` from `PurchasesOrchestrator` (#2540) via
NachoSoto (@NachoSoto)
* `enableAdServicesAttributionTokenCollection`: added integration test
(#2551) via NachoSoto (@NachoSoto)
* `AttributionPoster`: replaced hardcoded strings with constants (#2548)
via NachoSoto (@NachoSoto)
* `DefaultDecodable`: moved to `Misc/Codable/DefaultDecodable.swift`
(#2528) via NachoSoto (@NachoSoto)
* `CircleCI`: specify device to run `backend_integration_tests` (#2547)
via NachoSoto (@NachoSoto)
* Created `StoreKit2TransactionFetcher` (#2539) via NachoSoto
(@NachoSoto)
* Fix load shedder integration tests (#2546) via Josh Holtz
(@joshdholtz)
* Fix doc on `Offering.getMetadataValue` (#2545) via Josh Holtz
(@joshdholtz)
* Extracted and tested `AsyncSequence.extractValues` (#2538) via
NachoSoto (@NachoSoto)
* `Offline Entitlements`: don't compute offline `CustomerInfo` when
purchasing a consumable products (#2522) via NachoSoto (@NachoSoto)
* `OfflineEntitlementsManager`: disable offline `CustomerInfo` in
observer mode (#2520) via NachoSoto (@NachoSoto)
* `BasePurchasesTests`: fixed leak detection (#2534) via NachoSoto
(@NachoSoto)
* `PurchaseTesterSwiftUI`: added `ProxyView` to `iOS` (#2531) via
NachoSoto (@NachoSoto)
* `PurchasedProductsFetcher`: removed `AppStore.sync` call (#2521) via
NachoSoto (@NachoSoto)
* `PurchaseTesterSwiftUI`: added new window on Mac to manage proxy
(#2518) via NachoSoto (@NachoSoto)
* `PurchasedProductsFetcher`: added log if fetching purchased products
is slow (#2515) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: disable for custom entitlements mode (#2509)
via NachoSoto (@NachoSoto)
* `Offline Entitlements`: fixed iOS 12 tests (#2514) via NachoSoto
(@NachoSoto)
* `PurchasedProductsFetcher`: don't throw errors if purchased products
were found (#2506) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: allow creating offline `CustomerInfo` with
empty `ProductEntitlementMapping` (#2504) via NachoSoto (@NachoSoto)
* `Offline Entitlements`: integration tests (#2501) via NachoSoto
(@NachoSoto)
* `CustomerInfoManager`: don't cache offline `CustomerInfo` (#2378) via
NachoSoto (@NachoSoto)
* `DangerousSettings`: debug-only `forceServerErrors` (#2486) via
NachoSoto (@NachoSoto)
* `CocoapodsInstallation`: fixed `Xcode 14.3.0` issue (#2489) via
NachoSoto (@NachoSoto)
* `CarthageInstallation`: removed workaround (#2488) via NachoSoto
(@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.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