Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/93.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `create_time` field to webhook payload and `details.json`
4 changes: 4 additions & 0 deletions docs/generic_webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ A sample JSON body is as follows:

```json5
{
// Unique ID for this rageshake.
"id": "2022-01-25/154742-OOXBVGIX",
// The time this rageshake was submitted, in milliseconds past the epoch
"create_time": 1643125662456,
"user_text": "test\r\n\r\nIssue: No issue link given",
"app": "element-web",
"data": {
Expand Down
4 changes: 4 additions & 0 deletions submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ type payload struct {
Files []string `json:"files"`
// Set if there are file parsing errors
FileErrors []string `json:"fileErrors"`
// The time the rageshake was submitted, in milliseconds since the epoch
CreateTimeMillis int64 `json:"create_time"`
}

func (p payload) WriteTo(out io.Writer) {
Expand Down Expand Up @@ -253,6 +255,8 @@ func (s *submitServer) handleSubmission(w http.ResponseWriter, req *http.Request
// an issue tracker for instance with automatic rageshakes that can be plentiful
p.ID = prefix

p.CreateTimeMillis = t.Unix() * 1e3 // TODO: drop support for Go 1.16, use UnixMilli

resp, err := s.saveReport(req.Context(), *p, reportDir, listingURL)
if err != nil {
log.Println("Error handling report submission:", err)
Expand Down
Loading