-
Notifications
You must be signed in to change notification settings - Fork 412
Use AppTransaction.environment for sandbox detection
#6154
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
base: main
Are you sure you want to change the base?
Conversation
📸 Snapshot Test2 modified, 240 unchanged
🛸 Powered by Emerge Tools |
|
@RCGitBot please test |
fire-at-will
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! A few questions/comments, but I think this is on the right track :D
…(now it's only cached by `SandboxEnvironmentDetector`)
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
@RCGitBot please test |
|
@RCGitBot please test |
rickvdl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🙌
| /// | ||
| /// On iOS 16+, this attempts to use `AppTransaction.environment` for more reliable detection. | ||
| /// On older OS versions (and in case of failure to retrieve), it falls back to checking the receipt file path. | ||
| final class SandboxEnvironmentDetector: SandboxEnvironmentDetectorType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it helps much but for simplification we could have one SandboxEnvironmentDetector hold on to two specific implementations that also conform to SandboxEnvironmentDetectorType, one for the legacy code path and one for SK2. We could test them easily in isolation as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. We could do that. Honestly, I though about doing it like that initially but thought it might be overcomplicating things... I don't have a strong opinion though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also understand that reasoning. If it's a clean cut behind the protocol it might be worth it, if you need to implement specifics it might indeed be overcomplicating it. Not a strong opinion either :)
| let environment = await transactionFetcher.appTransactionEnvironment | ||
| self.cachedAppTransactionEnvironment.value = environment | ||
| } | ||
| // Task.detached { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking
This reverts commit c3dfa67.
|
@RCGitBot please test |
* [TEMP]: only run the CI that we want to run * only await when AppTransaction is available * decrease timeout from 10s -> 3s * dont run tests when on ios version that they shouldnt be run on * swiftlint * test fixes * compilation fix * test fix * Revert "[TEMP]: only run the CI that we want to run" This reverts commit 9aa0b2c.
* make carthage installation tests async * [TEMP]: run carthage tests
Description
AppTransaction.environmenton iOS 16+ instead of relying solely on the receipt file pathAppTransactionis unavailable