mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 15:22:50 +00:00
Fix issue where the EventReferenceSHA256 is not set
This commit is contained in:
parent
3bc4b357c6
commit
8ae34c4e5f
2 changed files with 6 additions and 2 deletions
|
@ -421,11 +421,13 @@ func (s *eventStatements) BulkSelectEventReference(
|
||||||
defer internal.CloseAndLogIfError(ctx, rows, "bulkSelectEventReference: rows.close() failed")
|
defer internal.CloseAndLogIfError(ctx, rows, "bulkSelectEventReference: rows.close() failed")
|
||||||
results := make([]gomatrixserverlib.EventReference, len(eventNIDs))
|
results := make([]gomatrixserverlib.EventReference, len(eventNIDs))
|
||||||
i := 0
|
i := 0
|
||||||
|
var eventSHA []byte
|
||||||
for ; rows.Next(); i++ {
|
for ; rows.Next(); i++ {
|
||||||
result := &results[i]
|
result := &results[i]
|
||||||
if err = rows.Scan(&result.EventID, &result.EventSHA256); err != nil {
|
if err = rows.Scan(&result.EventID, &eventSHA); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
result.EventSHA256 = eventSHA
|
||||||
}
|
}
|
||||||
if err = rows.Err(); err != nil {
|
if err = rows.Err(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -457,11 +457,13 @@ func (s *eventStatements) BulkSelectEventReference(
|
||||||
defer internal.CloseAndLogIfError(ctx, rows, "bulkSelectEventReference: rows.close() failed")
|
defer internal.CloseAndLogIfError(ctx, rows, "bulkSelectEventReference: rows.close() failed")
|
||||||
results := make([]gomatrixserverlib.EventReference, len(eventNIDs))
|
results := make([]gomatrixserverlib.EventReference, len(eventNIDs))
|
||||||
i := 0
|
i := 0
|
||||||
|
var eventSHA []byte
|
||||||
for ; rows.Next(); i++ {
|
for ; rows.Next(); i++ {
|
||||||
result := &results[i]
|
result := &results[i]
|
||||||
if err = rows.Scan(&result.EventID, &result.EventSHA256); err != nil {
|
if err = rows.Scan(&result.EventID, &eventSHA); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
result.EventSHA256 = eventSHA
|
||||||
}
|
}
|
||||||
if i != len(eventNIDs) {
|
if i != len(eventNIDs) {
|
||||||
return nil, fmt.Errorf("storage: event NIDs missing from the database (%d != %d)", i, len(eventNIDs))
|
return nil, fmt.Errorf("storage: event NIDs missing from the database (%d != %d)", i, len(eventNIDs))
|
||||||
|
|
Loading…
Reference in a new issue