LoadStateAtSnapshotForStringTuples loads the state for a list of event type and state key pairs at a snapshot. This is used when we only want to load a subset of the room state at a snapshot. If there is no entry for a given event type and state key pair then it will be discarded. This is typically
( ctx context.Context, stateNID types.StateSnapshotNID, stateKeyTuples []gomatrixserverlib.StateKeyTuple, )
| 288 | // This is typically the state before an event or the current state of a room. |
| 289 | // Returns a sorted list of state entries or an error if there was a problem talking to the database. |
| 290 | func (v *StateResolution) LoadStateAtSnapshotForStringTuples( |
| 291 | ctx context.Context, |
| 292 | stateNID types.StateSnapshotNID, |
| 293 | stateKeyTuples []gomatrixserverlib.StateKeyTuple, |
| 294 | ) ([]types.StateEntry, error) { |
| 295 | span, ctx := opentracing.StartSpanFromContext(ctx, "StateResolution.LoadStateAtSnapshotForStringTuples") |
| 296 | defer span.Finish() |
| 297 | |
| 298 | numericTuples, err := v.stringTuplesToNumericTuples(ctx, stateKeyTuples) |
| 299 | if err != nil { |
| 300 | return nil, err |
| 301 | } |
| 302 | return v.loadStateAtSnapshotForNumericTuples(ctx, stateNID, numericTuples) |
| 303 | } |
| 304 | |
| 305 | // stringTuplesToNumericTuples converts the string state key tuples into numeric IDs |
| 306 | // If there isn't a numeric ID for either the event type or the event state key then the tuple is discarded. |
no test coverage detected