Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios]Add errors reporting - #15391

Merged
m-stephen merged 4 commits into
masterfrom
stephen-ios-error-report
Sep 20, 2019
Merged

m-stephen merged 4 commits into
masterfrom
stephen-ios-error-report

Conversation

@m-stephen

Copy link
Copy Markdown
Contributor

close: #15011
For this case, only report errors for improving user experience.
We don't report any network related errors from this PR.

@m-stephen
m-stephen requested a review from julianrex August 16, 2019 07:38
@m-stephen
m-stephen requested a review from 1ec5 as a code owner August 16, 2019 07:38
@m-stephen
m-stephen requested a review from a team August 16, 2019 07:38
@m-stephen

Copy link
Copy Markdown
Contributor Author

@julianrex Could u help to review this PR?

@julianrex julianrex added the iOS Mapbox Maps SDK for iOS label Aug 20, 2019
@julianrex julianrex added this to the release-ristretto milestone Aug 20, 2019
@julianrex
julianrex requested review from friedbunny and removed request for a team and 1ec5 September 10, 2019 02:15
@julianrex

Copy link
Copy Markdown
Contributor

Apologies for the delay - I think it would be good to also report exceptions that are raised.

@m-stephen @friedbunny how about we create a convenience class method to replace raise:format:? Something like

-[NSException mgl_raise:format:] that internally calls -[MMEEventsManager reportException:]?

@m-stephen

Copy link
Copy Markdown
Contributor Author

Apologies for the delay - I think it would be good to also report exceptions that are raised.

@m-stephen @friedbunny how about we create a convenience class method to replace raise:format:? Something like

-[NSException mgl_raise:format:] that internally calls -[MMEEventsManager reportException:]?

Since I already want to report exceptions previously by this comment: #15011 (comment)
but it seems our telemetry SDK cannot do it right now:

According to @alfwatt's comment:

we don't have a way to flag an event as 'real time' or 'send immediately' right no, and I don't think we should start throwing exceptions unless there's a real programmer error. Better to use NSError objects and reportError:

@julianrex

@m-stephen

Copy link
Copy Markdown
Contributor Author

For more clear explanation, [MMEEventsManager reportException] add an exception event into an event queue but does not report this event immediately. It means when the app throw an exception this event will not report to server bcoz the event is still in the memory. @julianrex

@julianrex

Copy link
Copy Markdown
Contributor

Good point. I think we'll need to wait for deferred telemetry for this.

@julianrex

Copy link
Copy Markdown
Contributor

@m-stephen added a PR to this branch: #15633

@julianrex

Copy link
Copy Markdown
Contributor

@m-stephen can you rebase please?

@julianrex julianrex 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.

Looks good, thanks

@julianrex
julianrex requested review from frederoni and removed request for friedbunny September 17, 2019 15:07
@julianrex

Copy link
Copy Markdown
Contributor

@alfwatt would you mind taking a look at this PR to see if this matches your intentions with reportError please?

@julianrex

Copy link
Copy Markdown
Contributor

For tail work: can we please move the #if checks in lines like this into reportError?

#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
             [[MMEEventsManager sharedManager] reportError:error]; 
#endif

cc @alfwatt

@m-stephen

Copy link
Copy Markdown
Contributor Author

For tail work: can we please move the #if checks in lines like this into reportError?

#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
             [[MMEEventsManager sharedManager] reportError:error]; 
#endif

cc @alfwatt

Yes, it's better to move this into telemetry SDK.
But just in case, is reportError will also be used in macOS or carPlay devices? @alfwatt If so, we have to keep this or need to package a new function.

@julianrex

Copy link
Copy Markdown
Contributor

@m-stephen I believe you need to rebase on master, since Circle CI checks have changed.

@m-stephen
m-stephen force-pushed the stephen-ios-error-report branch from baa21b3 to eb1f8eb Compare September 19, 2019 10:40
@m-stephen
m-stephen merged commit 8128d70 into master Sep 20, 2019
@m-stephen
m-stephen deleted the stephen-ios-error-report branch September 20, 2019 02:14
@julianrex

Copy link
Copy Markdown
Contributor

Thanks for landing this. A few things please:

  • Can you list the types of errors, so that we can fine-tune the rules about what & why we report an error, so we know how and when to do so.
  • Can you confirm that these errors contain no PII?

@julianrex

Copy link
Copy Markdown
Contributor

@m-stephen ping!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for NSError and NSException reporting

2 participants