Problem Statement
Currently, SentryBaseEvent.contexts is exposed as an immutable map, which prevents beforeSend handlers from removing and adding to it. I would like to remove the device context, as it seems an unnecessary privacy concern.
Since the actual implementation is mutable, you can cast contexts to MutableMap and modify it, but any changes are ignored, since they are not copied back to the native field.
I've implemented a change that will copy changes to contexts back. I'm not sure if that's the right approach, or whether it would be better to add methods for removing and adding event contexts. Should I post a PR?
This is possibly related to KMP-3.
Solution Brainstorm
No response
Problem Statement
Currently,
SentryBaseEvent.contextsis exposed as an immutable map, which preventsbeforeSendhandlers from removing and adding to it. I would like to remove thedevicecontext, as it seems an unnecessary privacy concern.Since the actual implementation is mutable, you can cast
contextstoMutableMapand modify it, but any changes are ignored, since they are not copied back to the native field.I've implemented a change that will copy changes to
contextsback. I'm not sure if that's the right approach, or whether it would be better to add methods for removing and adding event contexts. Should I post a PR?This is possibly related to KMP-3.
Solution Brainstorm
No response