mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
fix(GODT-2327): Delay event processing until gluon user exists
We don't want to start processing events until those events have somewhere to be sent to. Also, to be safe, ensure remove and re-add the gluon user while clearing its sync status. This shouldn't be necessary. fix(GODT-2327): Only start processing events once sync is finished fix(GODT-2327): avoid windows delete all deadlock fix(GODT-2327): Clear update channels whenever clearing sync status fix(GODT-2327): Properly cancel event stream when handling refresh fix(GODT-2327): Remove unnecessary sync abort call fix(GODT-2327): Fix lint issue fix(GODT-2327): Don't retry with abortable context because it's canceled fix(GODT-2327): Loop to retry until sync has complete fix(GODT-2327): Better sleep (with context)
This commit is contained in:
@ -330,17 +330,18 @@ func (bridge *Bridge) loginUser(ctx context.Context, client *proton.Client, auth
|
||||
// loadUsers tries to load each user in the vault that isn't already loaded.
|
||||
func (bridge *Bridge) loadUsers(ctx context.Context) error {
|
||||
logrus.WithField("count", len(bridge.vault.GetUserIDs())).Info("Loading users")
|
||||
defer logrus.Info("Finished loading users")
|
||||
|
||||
return bridge.vault.ForUser(runtime.NumCPU(), func(user *vault.User) error {
|
||||
log := logrus.WithField("userID", user.UserID())
|
||||
|
||||
if user.AuthUID() == "" {
|
||||
log.Info("Not loading disconnected user")
|
||||
log.Info("User is not connected (skipping)")
|
||||
return nil
|
||||
}
|
||||
|
||||
if safe.RLockRet(func() bool { return mapHas(bridge.users, user.UserID()) }, bridge.usersLock) {
|
||||
log.Debug("Not loading already-loaded user")
|
||||
log.Info("User is already loaded (skipping)")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user