getsentry / getsentry/sentry

"Additional Data" in issue detail page omits empty strings from "extra" object

Open
#45,518 12 comments 0 reactions 0 assignees View on GitHub
Bug Waiting for: Product Owner
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
1d 5h
Merged PRs (30d)
624

Description

### Environment

* Sentry cloud
* self-hosted (https://develop.sentry.dev/self-hosted/)

### Version

* Sentry cloud as of 2023-10-19
* Self-hosted: 22.8.0

### Link

_No response_

### DSN

_No response_

### Steps to Reproduce

1. send an [error payload](https://develop.sentry.dev/sdk/event-payloads/#optional-attributes) containing `extra` with an empty string value, e.g. `{"extra": {"sha":"", "foo": "bar"}}`
2. visit issue page for created event

### Expected Result

any fields in `extra` that have empty strings as their value are displayed in the UI under "Additional Data", e.g.:

```
Additional Data

foo: bar
sha:
```

### Actual Result

Only non-empty strings are present in Additional Data - in our example `sha` is absent. The empty string fields are present in the JSON event navigable from the same page (i.e. it was not dropped on ingestion)

```
Additional Data

foo: bar
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.