mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Rename RemoveSession to DeleteSession in threepids database
This commit is contained in:
parent
e81c9c17b7
commit
503f43abe0
|
|
@ -15,7 +15,7 @@ type Database interface {
|
||||||
GetSession(ctx context.Context, sid string) (*api.Session, error)
|
GetSession(ctx context.Context, sid string) (*api.Session, error)
|
||||||
GetSessionByThreePidAndSecret(ctx context.Context, threePid, ClientSecret string) (*api.Session, error)
|
GetSessionByThreePidAndSecret(ctx context.Context, threePid, ClientSecret string) (*api.Session, error)
|
||||||
UpdateSendAttemptNextLink(ctx context.Context, sid, nextLink string) 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
|
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)
|
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 {
|
h := func(_ *sql.Tx) error {
|
||||||
_, err := d.stm.deleteSessionStmt.ExecContext(ctx, sid)
|
_, err := d.stm.deleteSessionStmt.ExecContext(ctx, sid)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ func TestBumpSendAttempt(t *testing.T) {
|
||||||
func TestDeleteSession(t *testing.T) {
|
func TestDeleteSession(t *testing.T) {
|
||||||
is := is.New(t)
|
is := is.New(t)
|
||||||
dut := mustNewDatabaseWithTestSession(is)
|
dut := mustNewDatabaseWithTestSession(is)
|
||||||
err := dut.RemoveSession(testCtx, testSession.Sid)
|
err := dut.DeleteSession(testCtx, testSession.Sid)
|
||||||
is.NoErr(err)
|
is.NoErr(err)
|
||||||
_, err = dut.GetSession(testCtx, testSession.Sid)
|
_, err = dut.GetSession(testCtx, testSession.Sid)
|
||||||
is.Equal(err, sql.ErrNoRows)
|
is.Equal(err, sql.ErrNoRows)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue