@@ -25,9 +25,7 @@ import (
2525 "strings"
2626 "time"
2727
28- "github.com/getsentry/sentry-go"
2928 "go.thethings.network/lorawan-stack/v3/pkg/errors"
30- sentryerrors "go.thethings.network/lorawan-stack/v3/pkg/errors/sentry"
3129 "go.thethings.network/lorawan-stack/v3/pkg/goproto"
3230 "go.thethings.network/lorawan-stack/v3/pkg/jsonpb"
3331 "go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
@@ -222,47 +220,14 @@ func Proto(e Event) (*ttnpb.Event, error) {
222220 pb .Context = ctx
223221 if evt .data != nil {
224222 var err error
225- // TODO: uncomment masrshalData and remove mustMarshalEventData after the issue mentioned
226- // below (7632) is fixed.
227- // pb.Data, err = marshalData(e.Data())
228- pb .Data , err = mustMarshalEventData (e )
223+ pb .Data , err = marshalData (e .Data ())
229224 if err != nil {
230225 return nil , err
231226 }
232227 }
233228 return pb , nil
234229}
235230
236- // TODO: remove after issue is resolved
237- // https://github.com/TheThingsNetwork/lorawan-stack/issues/7623
238- var errMarshalData = errors .Define ("marshal_data" , "marshal data" )
239-
240- func mustMarshalEventData (e Event ) (* anypb.Any , error ) {
241- defer func () {
242- if p := recover (); p != nil {
243- var err error
244- if pErr , ok := p .(error ); ok {
245- err = errMarshalData .WithCause (pErr ).WithAttributes (
246- "event_name" , e .Name (),
247- "event_correlation_ids" , e .CorrelationIds (),
248- "event_identifiers" , e .Identifiers (),
249- )
250- } else {
251- err = errMarshalData .WithAttributes (
252- "panic" , p ,
253- "event_name" , e .Name (),
254- "event_correlation_ids" , e .CorrelationIds (),
255- "event_identifiers" , e .Identifiers (),
256- )
257- }
258- event := sentryerrors .NewEvent (err )
259- sentry .CaptureEvent (event )
260- }
261- }()
262-
263- return marshalData (e .Data ())
264- }
265-
266231// FromProto returns the event from its protobuf representation.
267232func FromProto (pb * ttnpb.Event ) (Event , error ) {
268233 ctx , err := unmarshalContext (context .Background (), pb .Context )
0 commit comments