Skip to content

Support removing and adding event contexts #537

Description

@eranl

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions