From 503f43abe01e43eca569a37fb74b5f2a1ce3a46b Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Tue, 10 Aug 2021 10:39:06 +0200 Subject: [PATCH] Rename RemoveSession to DeleteSession in threepids database --- userapi/storage/threepid/storage.go | 4 ++-- userapi/storage/threepid/storage_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/userapi/storage/threepid/storage.go b/userapi/storage/threepid/storage.go index bb59030d5..a3cafa839 100644 --- a/userapi/storage/threepid/storage.go +++ b/userapi/storage/threepid/storage.go @@ -15,7 +15,7 @@ type Database interface { GetSession(ctx context.Context, sid string) (*api.Session, error) GetSessionByThreePidAndSecret(ctx context.Context, threePid, ClientSecret string) (*api.Session, error) UpdateSendAttemptNextLink(ctx context.Context, sid, nextLink string) error - RemoveSession(ctx context.Context, sid string) error + DeleteSession(ctx context.Context, sid string) error ValidateSession(ctx context.Context, sid string, validatedAt int) error } @@ -59,7 +59,7 @@ func (d *Db) UpdateSendAttemptNextLink(ctx context.Context, sid, nextLink string return d.writeHandler(h) } -func (d *Db) RemoveSession(ctx context.Context, sid string) error { +func (d *Db) DeleteSession(ctx context.Context, sid string) error { h := func(_ *sql.Tx) error { _, err := d.stm.deleteSessionStmt.ExecContext(ctx, sid) return err diff --git a/userapi/storage/threepid/storage_test.go b/userapi/storage/threepid/storage_test.go index 71036fd7c..ed9f79a84 100644 --- a/userapi/storage/threepid/storage_test.go +++ b/userapi/storage/threepid/storage_test.go @@ -69,7 +69,7 @@ func TestBumpSendAttempt(t *testing.T) { func TestDeleteSession(t *testing.T) { is := is.New(t) dut := mustNewDatabaseWithTestSession(is) - err := dut.RemoveSession(testCtx, testSession.Sid) + err := dut.DeleteSession(testCtx, testSession.Sid) is.NoErr(err) _, err = dut.GetSession(testCtx, testSession.Sid) is.Equal(err, sql.ErrNoRows)