diff --git a/src/github.com/matrix-org/dendrite/cmd/federation-api-proxy/main.go b/src/github.com/matrix-org/dendrite/cmd/federation-api-proxy/main.go index d1cba69ec..ed0aed722 100644 --- a/src/github.com/matrix-org/dendrite/cmd/federation-api-proxy/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/federation-api-proxy/main.go @@ -49,7 +49,7 @@ Arguments: var ( federationAPIURL = flag.String("federation-api-url", "", "The base URL of the listening 'dendrite-federation-api-server' process. E.g. 'http://localhost:4200'") bindAddress = flag.String("bind-address", ":8448", "The listening port for the proxy.") - certFile = flag.String("tls-cert", "server.crt", "The X509 certificate to use for TLS") + certFile = flag.String("tls-cert", "server.crt", "The PEM formatted X509 certificate to use for TLS") keyFile = flag.String("tls-key", "server.key", "The PEM private key to use for TLS") ) diff --git a/src/github.com/matrix-org/dendrite/federationapi/writers/send.go b/src/github.com/matrix-org/dendrite/federationapi/writers/send.go index 89acd5b99..fa366c2f0 100644 --- a/src/github.com/matrix-org/dendrite/federationapi/writers/send.go +++ b/src/github.com/matrix-org/dendrite/federationapi/writers/send.go @@ -136,7 +136,7 @@ func (t *txnReq) processEvent(e gomatrixserverlib.Event) error { if !stateResp.RoomExists { // TODO: When synapse receives a message for a room it is not in it - // asked the remote server for the state of the room so that it can + // asks the remote server for the state of the room so that it can // check if the remote server knows of a join "m.room.member" event // that this server is unaware of. // However generally speaking we should reject events for rooms we diff --git a/src/github.com/matrix-org/dendrite/roomserver/input/events.go b/src/github.com/matrix-org/dendrite/roomserver/input/events.go index 513d10ce5..b379b3aeb 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/input/events.go +++ b/src/github.com/matrix-org/dendrite/roomserver/input/events.go @@ -28,7 +28,7 @@ type RoomEventDatabase interface { StoreEvent(event gomatrixserverlib.Event, authEventNIDs []types.EventNID) (types.RoomNID, types.StateAtEvent, error) // Lookup the state entries for a list of string event IDs // Returns an error if the there is an error talking to the database - // or if the event IDs aren't in the database. + // Returns a types.MissingEventError if the event IDs aren't in the database. StateEntriesForEventIDs(eventIDs []string) ([]types.StateEntry, error) // Set the state at an event. SetState(eventNID types.EventNID, stateNID types.StateSnapshotNID) error diff --git a/src/github.com/matrix-org/dendrite/roomserver/state/state.go b/src/github.com/matrix-org/dendrite/roomserver/state/state.go index 6b49aba64..b5454c0cd 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/state/state.go +++ b/src/github.com/matrix-org/dendrite/roomserver/state/state.go @@ -32,7 +32,7 @@ type RoomStateDatabase interface { AddState(roomNID types.RoomNID, stateBlockNIDs []types.StateBlockNID, state []types.StateEntry) (types.StateSnapshotNID, error) // Lookup the state of a room at each event for a list of string event IDs. // Returns an error if there is an error talking to the database - // or if the room state for the event IDs aren't in the database + // Returns a types.MissingEventError if the room state for the event IDs aren't in the database StateAtEventIDs(eventIDs []string) ([]types.StateAtEvent, error) // Lookup the numeric IDs for a list of string event types. // Returns a map from string event type to numeric ID for the event type. diff --git a/src/github.com/matrix-org/dendrite/roomserver/storage/events_table.go b/src/github.com/matrix-org/dendrite/roomserver/storage/events_table.go index abbfaac82..a2813ae97 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/storage/events_table.go +++ b/src/github.com/matrix-org/dendrite/roomserver/storage/events_table.go @@ -166,6 +166,8 @@ func (s *eventStatements) selectEvent(eventID string) (types.EventNID, types.Sta return types.EventNID(eventNID), types.StateSnapshotNID(stateNID), err } +// 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 func (s *eventStatements) bulkSelectStateEventByID(eventIDs []string) ([]types.StateEntry, error) { rows, err := s.bulkSelectStateEventByIDStmt.Query(pq.StringArray(eventIDs)) if err != nil { @@ -201,6 +203,9 @@ func (s *eventStatements) bulkSelectStateEventByID(eventIDs []string) ([]types.S return results, err } +// bulkSelectStateAtEventByID lookups the state at a list of events by event ID. +// If any of the requested events are missing from the database it returns a types.MissingEventError. +// If we do not have the state for any of the requested events it returns a types.MissingEventError. func (s *eventStatements) bulkSelectStateAtEventByID(eventIDs []string) ([]types.StateAtEvent, error) { rows, err := s.bulkSelectStateAtEventByIDStmt.Query(pq.StringArray(eventIDs)) if err != nil {