mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 02:23:10 -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 == "" {
|
if req.Version == "" {
|
||||||
res.BadInput = true
|
res.BadInput = true
|
||||||
res.Error = "must specify a version to delete"
|
res.Error = "must specify a version to delete"
|
||||||
if res.Error != "" {
|
|
||||||
return fmt.Errorf(res.Error)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
exists, err := a.DB.DeleteKeyBackup(ctx, req.UserID, req.Version)
|
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.Exists = exists
|
||||||
res.Version = req.Version
|
res.Version = req.Version
|
||||||
if res.Error != "" {
|
|
||||||
return fmt.Errorf(res.Error)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Create metadata
|
// Create metadata
|
||||||
|
|
@ -570,9 +564,6 @@ func (a *UserInternalAPI) PerformKeyBackup(ctx context.Context, req *api.Perform
|
||||||
}
|
}
|
||||||
res.Exists = err == nil
|
res.Exists = err == nil
|
||||||
res.Version = version
|
res.Version = version
|
||||||
if res.Error != "" {
|
|
||||||
return fmt.Errorf(res.Error)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Update metadata
|
// Update metadata
|
||||||
|
|
@ -583,16 +574,10 @@ func (a *UserInternalAPI) PerformKeyBackup(ctx context.Context, req *api.Perform
|
||||||
}
|
}
|
||||||
res.Exists = err == nil
|
res.Exists = err == nil
|
||||||
res.Version = req.Version
|
res.Version = req.Version
|
||||||
if res.Error != "" {
|
|
||||||
return fmt.Errorf(res.Error)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Upload Keys for a specific version metadata
|
// Upload Keys for a specific version metadata
|
||||||
a.uploadBackupKeys(ctx, req, res)
|
a.uploadBackupKeys(ctx, req, res)
|
||||||
if res.Error != "" {
|
|
||||||
return fmt.Errorf(res.Error)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue