Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jazzychad
Copy link
Contributor

  • If the current build is a debug build, SignalPayload.isTestFlight will now return false.
  • Adds an isDebug payload key

- If the current build is a debug build, SignalPayload.isTestFlight will now return false.
- Adds an `isDebug` payload key
@jazzychad
Copy link
Contributor Author

⚠️ A couple of potential issues with the way this is implemented:

  • It is possible (but probably rare) that a developer would make a testflight build in a Debug configuration (by changing the Archive setting in the scheme from Release to Debug). This would defeat the debug/testflight detection implemented in this patch.

  • I'm not sure how necessary it is to add an isDebug key to the payload b/c presumably it will only be relevant for a very small number of signals actually sent to the server (and can be inferred from other payload key values). I am happy to remove that isDebug key addition if would make more sense.


static var isTestFlight: Bool {
guard let path = Bundle.main.appStoreReceiptURL?.path else {
guard !isDebug, let path = Bundle.main.appStoreReceiptURL?.path else {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

re-iterating from general PR comment: It is possible (but probably rare) that a developer would make a testflight build in a Debug configuration (by changing the Archive setting in the scheme from Release to Debug). This would defeat the debug/testflight detection implemented in this patch.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is smart! I like it!

var appVersion: String = Self.appVersion
var buildNumber: String = Self.buildNumber
var isSimulator: String = "\(Self.isSimulator)"
var isDebug: String = "\(Self.isDebug)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

re-iterating from general PR comment: I'm not sure how necessary it is to add an isDebug key to the payload b/c presumably it will only be relevant for a very small number of signals actually sent to the server (and can be inferred from other payload key values). I am happy to remove that isDebug key addition if would make more sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't hurt -- in fact I had an isDebug key in the payload for a long time and only recently removed it. It'll help people filter between debug and non debug signals

@winsmith
Copy link
Contributor

Thanks a lot for this contribution <3

@winsmith winsmith merged commit d4e89df into TelemetryDeck:main Aug 13, 2021
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