Closed jkmassel closed 3 years ago
While trying to test this, bundle exec pod install
failed to resolve the dependency for Sentry:
$ be pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Sentry":
In snapshot (Podfile.lock):
Sentry (= 6.1.2, ~> 6)
In Podfile:
Automattic-Tracks-iOS (from `../`) was resolved to 0.7.0, which depends on
Sentry (~> 6)
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* changed the constraints of dependency `Sentry` inside your development pod `Automattic-Tracks-iOS`.
You should run `pod update Sentry` to apply changes you've made.
I had to bundle exec pod update Sentry
first, which led to a bump from Sentry 6.1.2 to 6.1.3 and left the Podfile.lock
with a diff accordingly.
Also, regarding the Shared/Secrets.swift
, for anyone who might have been as confused as I was (cc @mokagio) trying to follow the testing instructions in PR description:
Shared/Secrets.swift
file are not in our Secret Store in MC… but in our Mobile Secrets repo instead.cp Shared/Secrets.example.swift Shared/Secrets.swift
in the first place (like I did and guessed I needed to do before trying to find the DSN in Secret Store) because the Secrets.swft
file is already present in full in our Mobile Secrets repo (i.e. not just the sentryDSN to use for tests, but the whole swift file), so that's the one we should copy for testing.[EDIT: I took the liberty to edit the PR description to take those remarks ☝️ into account]
@mokagio and @AliSoftware, thanks for the feedback – it should all be addressed now – ready for another look when you're ready 😃
One last change – I didn't realize the schemes weren't shared – I've added them to the repo in 901bf1d3a3aa82ef4201e223892323efd400db91. That should fix the issue where in testing the "Send Test Event" wouldn't work (it needs to override the debug
mode).
Tested on iPhone Simulator (iPhone 11 Pro, iOS 13.5) and on Intel Mac. Was able to see both events in Sentry ("Send Test Event" + "Send Error and Wait") in both cases
I got this log in Xcode console each time I clicked the button when testing with the iPhone Simulator app. I'm not entirely sure it's expected to especially get the "Cancelling log file attachment"? 🤔
2021-01-22 16:25:22:594 TracksDemo[77872:5993852] 📜 Firing `beforeSend`
2021-01-22 16:25:22.594496+0100 TracksDemo[77872:5994015] 📜 Firing `beforeSend`
2021-01-22 16:25:22:594 TracksDemo[77872:5993852] 📜 This is a debug build
2021-01-22 16:25:22.594710+0100 TracksDemo[77872:5994015] 📜 This is a debug build
2021-01-22 16:25:22:594 TracksDemo[77872:5993852] 📜 Cancelling log file attachment – Event Logging is not initialized
2021-01-22 16:25:22.594901+0100 TracksDemo[77872:5994015] 📜 Cancelling log file attachment – Event Logging is not initialized
I also still got a diff on the Podfile.lock
even after cleaning my Pods/
and working copy and redoing a pod install
… but this time a different one.
I got this log in Xcode console each time I clicked the button when testing with the iPhone Simulator app. I'm not entirely sure it's expected to especially get the "Cancelling log file attachment"? 🤔
That's expected – the encrypted logging system isn't injected into CrashLogging
, so we log the fact that we're not uploading an encrypted log for this crash. This is especially important when debugging in-app so devs aren't confused why no logs are showing up and there's no logId
associated with the Sentry event.
Thanks for the detailed instructions – I was able to replicate that issue this time!
This time I think it was caused by the merge with develop
?
But should be resolved now 😅
Updates the Sentry library to v6, which enables:
Unfortunately, the v6 library takes away our ability to manually send events to Sentry, so this PR adds that ability back by using the API directly.
Previously to this PR, testing Sentry integration was always a bit tricky because we'd need to integrate into a host app and make weird changes to it in order to test the integration.
This PR adds the ability to test Sentry functionality from the example project.
To Test:
cd
into theTracksDemo
directory and runbundle exec pod install
Shared/Secrets.swift
file:iOS/tracks-demo
). You might need to update (git pull
) the mobile secrets repo first.Shared/Secrets.example.swift
and fill in the missing detailsconfigure
functionality to automate this, but it's not part of this PR in order to avoid making it any larger.tracks-demo
project with an associated stack trace.Additional M1-specific tests:
Any iOS Device
My Mac
, andAny Mac (Apple Silicon, Intel)
[ note: you may need to clean your build directory first – this tends to fail otherwise – I assume this is an Xcode bug ]I'd love one review on this from a mobile infrastructure engineer as well as a review from someone who has M1 hardware to test with.