bridgev2/networkinterface: don't allow returning errors in Connect
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

This commit is contained in:
Tulir Asokan 2024-11-29 18:21:41 +02:00
commit e3d5267485
2 changed files with 4 additions and 5 deletions

View file

@ -187,10 +187,7 @@ func (br *Bridge) StartLogins() error {
for _, login := range user.GetUserLogins() {
startedAny = true
br.Log.Info().Str("id", string(login.ID)).Msg("Starting user login")
err = login.Client.Connect(login.Log.WithContext(ctx))
if err != nil {
br.Log.Err(err).Msg("Failed to connect existing client")
}
login.Client.Connect(login.Log.WithContext(ctx))
}
}
}

View file

@ -344,7 +344,9 @@ type NetworkRoomCapabilities struct {
type NetworkAPI interface {
// Connect is called to actually connect to the remote network.
// If there's no persistent connection, this may just check access token validity, or even do nothing at all.
Connect(ctx context.Context) error
// This method isn't allowed to return errors, because any connection errors should be sent
// using the bridge state mechanism (UserLogin.BridgeState.Send)
Connect(ctx context.Context)
// Disconnect should disconnect from the remote network.
// A clean disconnection is preferred, but it should not take too long.
Disconnect()