Improve feed loader, wait for db before executing reads/updates, make taskQueue subscribable, add race, rename auth methods, fix failed wasm verify, fix localhost urls

This commit is contained in:
Jon Staab
2025-04-09 15:39:07 -07:00
parent 1bcc57d695
commit 859f7fa68f
14 changed files with 155 additions and 32 deletions
+5 -5
View File
@@ -107,11 +107,11 @@ describe("auth", () => {
})
})
describe("authenticate", () => {
describe("doAuth", () => {
it("should throw an error when there is no challenge", async () => {
const sign = vi.fn()
await expect(socket.auth.authenticate(sign)).rejects.toThrow(
await expect(socket.auth.doAuth(sign)).rejects.toThrow(
"Attempted to authenticate with no challenge",
)
})
@@ -122,7 +122,7 @@ describe("auth", () => {
socket.auth.challenge = "challenge123"
socket.auth.status = AuthStatus.PendingResponse
await expect(socket.auth.authenticate(sign)).rejects.toThrow(
await expect(socket.auth.doAuth(sign)).rejects.toThrow(
"Attempted to authenticate when auth is already auth:status:pending_response",
)
})
@@ -133,7 +133,7 @@ describe("auth", () => {
socket.auth.challenge = "challenge123"
socket.auth.status = AuthStatus.Requested
await socket.auth.authenticate(sign)
await socket.auth.doAuth(sign)
expect(socket.auth.status).toBe(AuthStatus.DeniedSignature)
})
@@ -151,7 +151,7 @@ describe("auth", () => {
return event
}
await socket.auth.authenticate(sign)
await socket.auth.doAuth(sign)
expect(socket.auth.request).toStrictEqual(event!.id)
expect(sendSpy).toHaveBeenCalledWith(["AUTH", event])