LoadStateAtEvent loads the full state of a room before a particular event.
( ctx context.Context, eventID string, )
| 126 | |
| 127 | // LoadStateAtEvent loads the full state of a room before a particular event. |
| 128 | func (v *StateResolution) LoadStateAtEventForHistoryVisibility( |
| 129 | ctx context.Context, eventID string, |
| 130 | ) ([]types.StateEntry, error) { |
| 131 | span, ctx := opentracing.StartSpanFromContext(ctx, "StateResolution.LoadStateAtEvent") |
| 132 | defer span.Finish() |
| 133 | |
| 134 | snapshotNID, err := v.db.SnapshotNIDFromEventID(ctx, eventID) |
| 135 | if err != nil { |
| 136 | return nil, fmt.Errorf("LoadStateAtEvent.SnapshotNIDFromEventID failed for event %s : %w", eventID, err) |
| 137 | } |
| 138 | if snapshotNID == 0 { |
| 139 | return nil, fmt.Errorf("LoadStateAtEvent.SnapshotNIDFromEventID(%s) returned 0 NID, was this event stored?", eventID) |
| 140 | } |
| 141 | |
| 142 | stateEntries, err := v.LoadStateAtSnapshot(ctx, snapshotNID) |
| 143 | if err != nil { |
| 144 | return nil, err |
| 145 | } |
| 146 | |
| 147 | return stateEntries, nil |
| 148 | } |
| 149 | |
| 150 | // LoadCombinedStateAfterEvents loads a snapshot of the state after each of the events |
| 151 | // and combines those snapshots together into a single list. At this point it is |
nothing calls this directly
no test coverage detected