Uh oh!
There was an error while loading. Please reload this page.
fix(core): Reset contexts when a scope is cleared - #5895
Open
limbonaut wants to merge 4 commits into
Open
Conversation
limbonaut
commented
Aug 5, 2026
| attributes.clear(); | ||
| extra.clear(); | ||
| contexts.clear(); | ||
| eventProcessors.clear(); |
CollaboratorAuthor
There was a problem hiding this comment.
Also worth mentioning another thing from Scopes spec: "keeping event processors". Currently, they are cleared. I'm not sure if it's an intentional deviation.
📲 Install BuildsAndroid
|
limbonaut
marked this pull request as ready for review
August 5, 2026 19:32
limbonaut
requested review from
0xadam-brown, adinauer, markushi, romtsn and runningcode
as code ownersAugust 5, 2026 19:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Scope.clear()is documented as resetting the scope to its default state, but it never touchedcontexts, so anything set throughsetContextssurvived a clear. Every other field the public API writes to was already being reset. This adds aclear()toContextsand calls it fromScope.clear();CombinedContextsViewoverrides it to delegate to the default scope, matching how it already handlesputandremove. Other SDKs, such as JavaScript, Python, Cocoa and native all clear contexts as part of their scope clear. Surfaced while implementing per-capture scopes for the Godot SDK, where identical game code dropped the context on desktop but kept it on Android.💡 Motivation and Context
Dev docs describe
clearasSo this change brings implementation closer to spec.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps