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: set scope on transaction #1409

Merged
merged 2 commits into from
Apr 19, 2021
Merged

Fix: set scope on transaction #1409

merged 2 commits into from
Apr 19, 2021

Conversation

maciejwalkowiak
Copy link
Contributor

📜 Description

Fix: set scope on transaction

💡 Motivation and Context

Until now, only request has been set from the scope on transaction.

💚 How did you test it?

Unit tests

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

I believe applying scope deserves a refactoring. We can add a method on SentryBaseEvent#applyScope(scope) which will get overwritten in SentryTransaction and SentryEvent.

@maciejwalkowiak
Copy link
Contributor Author

cc @bruno-garcia

@@ -521,6 +490,37 @@ public void captureSession(final @NotNull Session session, final @Nullable Objec
return event;
}

private <T extends SentryBaseEvent> T applyScope(
final @NotNull T sentryBaseEvent, final @Nullable Scope scope) {
Copy link
Contributor

Choose a reason for hiding this comment

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

there's already a NPE check to call this method, hence Scope can be non null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the transaction we use this method directly, that's why it's kept as nullable.

@maciejwalkowiak maciejwalkowiak marked this pull request as draft April 16, 2021 13:04
@maciejwalkowiak
Copy link
Contributor Author

Converting back to draft, since we need first to marge event processing on transactions.

@maciejwalkowiak maciejwalkowiak marked this pull request as ready for review April 19, 2021 07:15
@maciejwalkowiak
Copy link
Contributor Author

Converting back to draft, since we need first to marge event processing on transactions.

Wrong PR.

@maciejwalkowiak maciejwalkowiak merged commit 838067f into main Apr 19, 2021
@maciejwalkowiak maciejwalkowiak deleted the transaction-scope branch April 19, 2021 07:16
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