@@ -20,6 +20,46 @@ Currently very experimental and PoC.
2020
2121### To use:  
2222
23+ Apply a minimal debugging patch to your dendrite's gomatrixserverlib:
24+ 
25+ ``` patch 
26+ diff --git a/event.go b/event.go 
27+ index f0564fe..05ed845 100644
28+ --- a/event.go 
29+ +++ b/event.go 
30+ @@ -1010,6 +1010,7 @@  func (e Event) Headered(roomVersion RoomVersion) HeaderedEvent {
31+         return HeaderedEvent{
32+                 EventHeader: EventHeader{
33+                         RoomVersion: roomVersion,
34+ +                        DebugEventID: e.EventID(),
35+                 },
36+                 Event: e,
37+         }
38+ diff --git a/headeredevent.go b/headeredevent.go 
39+ index 414230c..c711436 100644
40+ --- a/headeredevent.go 
41+ +++ b/headeredevent.go 
42+ @@ -13,10 +13,15 @@  import (
43+  // this struct must have a "json:" name tag or otherwise the reflection
44+  // code for marshalling and unmarshalling headered events will not work.
45+  // They must be unique and not overlap with a name tag from the Event
46+ - // struct or otherwise panics may occur, so header  name tags are instead
47+ + // struct or otherwise panics may occur, so header name tags are instead
48+  // prefixed with an underscore.
49+  type EventHeader struct {
50+         RoomVersion RoomVersion `json:"_room_version,omitempty"`
51+ + 
52+ +        // This is needed because otherwise Room V3+ events don't
53+ +        // marshal an explicit EventID into their JSON, which makes debugging
54+ +        // hard for things like TARDIS timetravel debugging.
55+ +        DebugEventID string     `json:"_event_id,omitempty"`
56+  }
57+  
58+  // HeaderedEvent is a wrapper around an Event that contains information
59+ ``` 
60+ 
61+ And then to run it, tweak the config in src/index.js, and:
62+ 
2363``` 
2464yarn install 
2565yarn run start 
0 commit comments