Skip to content
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

Fix automatic game log attachment (Android) #309

Merged
merged 9 commits into from
Jun 23, 2023

Conversation

tustanivsky
Copy link
Collaborator

Related to #302

if(!gameLogPath.isEmpty()) {
scope.addAttachment(new Attachment(gameLogPath));
}
options.setBeforeSend(new SentryOptions.BeforeSendCallback() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not entirely sure how that works underneath but can that callback be overwritten by users?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't expose any APIs allowing users to do that, so it should be safe to set the beforeSend hook like this.

Copy link
Contributor

@bitsandfoxes bitsandfoxes Jun 21, 2023

Choose a reason for hiding this comment

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

Considering that we want to expose that API in the future, we could add this as an event-processor/integration instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think it should be feasible.

options.setBeforeSend(new SentryOptions.BeforeSendCallback() {
@Override
public SentryEvent execute(SentryEvent event, Hint hint) {
if(event.isCrashed() && event.isErrored())
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't that mean that if the app crashed in the run before the gamelogs from the current run won't be part of any current events?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, after sending the crash event on app startup all subsequent events should be treated as usual with a current session's game log attached.

@bitsandfoxes bitsandfoxes merged commit da26ef3 into main Jun 23, 2023
@bitsandfoxes bitsandfoxes deleted the fix/game-log-attachment branch June 23, 2023 12:47
@github-actions
Copy link
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Fix automatic game log attachment (Android) ([#309](https://github.com/getsentry/sentry-unreal/pull/309))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against a7f0c0c

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