forked from Silverfish/proton-bridge
fix: don't delete uid of anonymous clients
This commit is contained in:
@ -180,7 +180,9 @@ func hasAPIAuth(accountName string) error {
|
||||
if err != nil {
|
||||
return internalError(err, "getting user %s", account.Username())
|
||||
}
|
||||
a.True(ctx.GetTestingT(), bridgeUser.HasAPIAuth())
|
||||
a.Eventually(ctx.GetTestingT(), func() bool {
|
||||
return bridgeUser.HasAPIAuth()
|
||||
}, 5*time.Second, 10*time.Millisecond)
|
||||
return ctx.GetTestingError()
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,9 @@ func (api *FakePMAPI) GetEvent(eventID string) (*pmapi.Event, error) {
|
||||
}
|
||||
// Request for empty ID returns the latest event.
|
||||
if eventID == "" {
|
||||
if len(api.events) == 0 {
|
||||
return &pmapi.Event{EventID: ""}, nil
|
||||
}
|
||||
return api.events[len(api.events)-1], nil
|
||||
}
|
||||
// Otherwise it tries to find specific ID and return all next events merged into one.
|
||||
|
||||
@ -104,12 +104,9 @@ func (api *FakePMAPI) checkInternetAndRecordCall(method method, path string, req
|
||||
}
|
||||
|
||||
func (api *FakePMAPI) sendAuth(auth *pmapi.Auth) {
|
||||
go func() {
|
||||
api.controller.clientManager.GetClientAuthChannel() <- pmapi.ClientAuth{
|
||||
UserID: api.user.ID,
|
||||
Auth: auth,
|
||||
}
|
||||
}()
|
||||
go func(clientAuth pmapi.ClientAuth) {
|
||||
api.controller.clientManager.GetClientAuthChannel() <- clientAuth
|
||||
}(pmapi.ClientAuth{UserID: api.user.ID, Auth: auth})
|
||||
}
|
||||
|
||||
func (api *FakePMAPI) setUser(username string) error {
|
||||
|
||||
Reference in New Issue
Block a user