firebase / firebase/functions-samples

[BUG] in sample: alert

Open
#1,089 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
12.2k
Forks
3.8k
Avg merge
3d 23h
Merged PRs (30d)
1

Description

### Which sample has a bug?
https://github.com/firebase/functions-samples/blob/main/Node/alerts-to-discord/functions/index.js

In this demo the param (event) is a **CrashlyticsEvent** type, but actually it's a **NewFatalIssuePayload** type
image
it's shows the error when I use the `const {id, title, subtitle, appVersion} = event.data.payload.issue;`

after I fix it to `const {id, title, subtitle, appVersion} = event.payload.issue;` it successed,
But there is another problem, how can I get the appId to confirm which app has encounter the crash.

IMO, the event data should like

```json
{
"id": "2133",
"source": "iOS",
"type": "crash",
"appId": "32444",
"alertType":"crashlytics.newFatalIssue",
"data": {
"creatTime": "2023/3/22 8:00:33",
"endTime": "2023/3/22 8:00:33",
"payload": {
"issue": {
"id":"3244242",
"title": "there is a crash",
"subTitle": "subtitle",
"appVersion": "3.24"
}
}
}
}
```

but it was

```json
{
"data": {
"creatTime": "2023/3/22 8:00:33",
"endTime": "2023/3/22 8:00:33",
"payload": {
"issue": {
"id":"3244242",
"title": "there is a crash",
"subTitle": "subtitle",
"appVersion": "3.24"
}
}
}
```

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.