mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-10 23:53:09 -06:00
Maybe fix the key backup test
This commit is contained in:
parent
11802a007e
commit
155fecb300
|
|
@ -546,9 +546,6 @@ func (a *UserInternalAPI) PerformKeyBackup(ctx context.Context, req *api.Perform
|
|||
if req.Version == "" {
|
||||
res.BadInput = true
|
||||
res.Error = "must specify a version to delete"
|
||||
if res.Error != "" {
|
||||
return fmt.Errorf(res.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
exists, err := a.DB.DeleteKeyBackup(ctx, req.UserID, req.Version)
|
||||
|
|
@ -557,9 +554,6 @@ func (a *UserInternalAPI) PerformKeyBackup(ctx context.Context, req *api.Perform
|
|||
}
|
||||
res.Exists = exists
|
||||
res.Version = req.Version
|
||||
if res.Error != "" {
|
||||
return fmt.Errorf(res.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
// Create metadata
|
||||
|
|
@ -570,9 +564,6 @@ func (a *UserInternalAPI) PerformKeyBackup(ctx context.Context, req *api.Perform
|
|||
}
|
||||
res.Exists = err == nil
|
||||
res.Version = version
|
||||
if res.Error != "" {
|
||||
return fmt.Errorf(res.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
// Update metadata
|
||||
|
|
@ -583,16 +574,10 @@ func (a *UserInternalAPI) PerformKeyBackup(ctx context.Context, req *api.Perform
|
|||
}
|
||||
res.Exists = err == nil
|
||||
res.Version = req.Version
|
||||
if res.Error != "" {
|
||||
return fmt.Errorf(res.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
// Upload Keys for a specific version metadata
|
||||
a.uploadBackupKeys(ctx, req, res)
|
||||
if res.Error != "" {
|
||||
return fmt.Errorf(res.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue