mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-11 16:13:10 -06:00
Review comments
This commit is contained in:
parent
9347c4fe0d
commit
723fc64610
|
|
@ -39,7 +39,7 @@ func CheckForSoftFail(
|
|||
var authStateEntries []types.StateEntry
|
||||
var err error
|
||||
if rewritesState {
|
||||
authStateEntries, err = db.StateEntriesForEventIDs(ctx, stateEventIDs, false)
|
||||
authStateEntries, err = db.StateEntriesForEventIDs(ctx, stateEventIDs, true)
|
||||
if err != nil {
|
||||
return true, fmt.Errorf("StateEntriesForEventIDs failed: %w", err)
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ func CheckAuthEvents(
|
|||
authEventIDs []string,
|
||||
) ([]types.EventNID, error) {
|
||||
// Grab the numeric IDs for the supplied auth state events from the database.
|
||||
authStateEntries, err := db.StateEntriesForEventIDs(ctx, authEventIDs, false)
|
||||
authStateEntries, err := db.StateEntriesForEventIDs(ctx, authEventIDs, true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("db.StateEntriesForEventIDs: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,9 @@ func (s *eventStatements) SelectEvent(
|
|||
}
|
||||
|
||||
// bulkSelectStateEventByID lookups a list of state events by event ID.
|
||||
// If any of the requested events are missing from the database it returns a types.MissingEventError
|
||||
// If not excluding rejected events, and any of the requested events are missing from
|
||||
// the database it returns a types.MissingEventError. If excluding rejected events,
|
||||
// the events will be silently omitted without error.
|
||||
func (s *eventStatements) BulkSelectStateEventByID(
|
||||
ctx context.Context, txn *sql.Tx, eventIDs []string, excludeRejected bool,
|
||||
) ([]types.StateEntry, error) {
|
||||
|
|
|
|||
|
|
@ -204,7 +204,9 @@ func (s *eventStatements) SelectEvent(
|
|||
}
|
||||
|
||||
// bulkSelectStateEventByID lookups a list of state events by event ID.
|
||||
// If any of the requested events are missing from the database it returns a types.MissingEventError
|
||||
// If not excluding rejected events, and any of the requested events are missing from
|
||||
// the database it returns a types.MissingEventError. If excluding rejected events,
|
||||
// the events will be silently omitted without error.
|
||||
func (s *eventStatements) BulkSelectStateEventByID(
|
||||
ctx context.Context, txn *sql.Tx, eventIDs []string, excludeRejected bool,
|
||||
) ([]types.StateEntry, error) {
|
||||
|
|
@ -250,7 +252,7 @@ func (s *eventStatements) BulkSelectStateEventByID(
|
|||
}
|
||||
results = append(results, result)
|
||||
}
|
||||
if i != len(eventIDs) {
|
||||
if !excludeRejected && i != len(eventIDs) {
|
||||
// If there are fewer rows returned than IDs then we were asked to lookup event IDs we don't have.
|
||||
// We don't know which ones were missing because we don't return the string IDs in the query.
|
||||
// However it should be possible debug this by replaying queries or entries from the input kafka logs.
|
||||
|
|
|
|||
Loading…
Reference in a new issue