Add ID field containing the prefix used to create the listing.
This listing needs to be unique for the rageshake to be stored to disk, so can be relied upon in future to be unique(enough) for other services working with the rageshake.
This commit is contained in:
parent
1d008a0aad
commit
7cb7309097
1 changed files with 6 additions and 0 deletions
|
@ -85,6 +85,7 @@ type genericWebhookPayload struct {
|
||||||
|
|
||||||
// the payload after parsing
|
// the payload after parsing
|
||||||
type parsedPayload struct {
|
type parsedPayload struct {
|
||||||
|
ID string `json:"id"`
|
||||||
UserText string `json:"user_text"`
|
UserText string `json:"user_text"`
|
||||||
AppName string `json:"app"`
|
AppName string `json:"app"`
|
||||||
Data map[string]string `json:"data"`
|
Data map[string]string `json:"data"`
|
||||||
|
@ -178,6 +179,11 @@ func (s *submitServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We use this prefix (eg, 2022-05-01/125223-abcde) as a unique identifier for this rageshake.
|
||||||
|
// This is going to be used to uniquely identify rageshakes, even if they are not submitted to
|
||||||
|
// an issue tracker for instance with automatic rageshakes that can be plentiful
|
||||||
|
p.ID = prefix
|
||||||
|
|
||||||
resp, err := s.saveReport(req.Context(), *p, reportDir, listingURL)
|
resp, err := s.saveReport(req.Context(), *p, reportDir, listingURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error handling report submission:", err)
|
log.Println("Error handling report submission:", err)
|
||||||
|
|
Reference in a new issue