feat(sync): paginate Android sync with change tokens
This commit is contained in:
1 parent
0ff94f9b10
commit
97c237be80
76 files changed
+3401
-851
No files matched your search
@@ -9,11 +9,28 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
|
||||
sharedauth "repos.gfranz.ch/Gabriel20xx/shared/backend/auth"
|
||||
"repos.gfranz.ch/Gabriel20xx/shared/backend/authclient"
|
||||
)
|
||||
|
||||
func TestSettingValueReturnsDatabaseErrors(t *testing.T) {
|
||||
db, err := pgxpool.New(context.Background(), "postgres://nobody@127.0.0.1:1/none?sslmode=disable&connect_timeout=1")
|
||||
if err != nil {
|
||||
t.Fatalf("pgxpool.New: %v", err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
value, err := SettingValue(context.Background(), db, "example", "fallback")
|
||||
if err == nil || value != "" {
|
||||
t.Fatalf("SettingValue() = %q, %v; want empty value and database error", value, err)
|
||||
}
|
||||
if got := SettingValueOrFallback(context.Background(), db, "example", "fallback"); got != "fallback" {
|
||||
t.Fatalf("SettingValueOrFallback() = %q, want fallback on error", got)
|
||||
}
|
||||
}
|
||||
|
||||
// loginRequiredStore is a ProxyStore that always requires login, so the auth gate can be
|
||||
// exercised without a database.
|
||||
type loginRequiredStore struct{}
|
||||
|
||||
Reference in new issue
Block a user