Skip to content

Support removing and adding event contexts #537

@eranl

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

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions