on master help sign in
Fix Knot syntax: remove extra parentheses and semicolons in federation handling
bca43fbiko
server.knot+3−3
@@ -1873,11 +1873,11 @@ sendCancelToEach = \messageId to servers -> forEach servers (\server -> do
1873 authorization: auth,
1873 authorization: auth,
1874 protocolVersion: federationProtocolVersion
1874 protocolVersion: federationProtocolVersion
1875 })
1875 })
1876− when (case result of; Err _ -> True {}; Ok {value: r} -> not r.ok) (atomic (do
1876+ when (case result of Err _ -> True {}; Ok {value: r} -> not r.ok) (atomic do
1877 cur <- *pendingFederationCancels
1877 cur <- *pendingFederationCancels
1878 *pendingFederationCancels = capList (union cur [
1878 *pendingFederationCancels = capList (union cur [
1879 {messageId, toKey: to, toServer: server, createdAt: t, retries: 0}
1879 {messageId, toKey: to, toServer: server, createdAt: t, retries: 0}
1880− ]) 10000 (\c -> c.createdAt))))
1880+ ]) 10000 (\c -> c.createdAt)))
1881
1881
1882-- POST /messages/cancel-batch: multi-id sender-side cancel. Same ownership
1882-- POST /messages/cancel-batch: multi-id sender-side cancel. Same ownership
1883-- check as `handleCancelMessage`, applied independently per entry.
1883-- check as `handleCancelMessage`, applied independently per entry.
@@ -1939,7 +1939,7 @@ handleVerifyToken = \token scope clientIp respond -> do
1939 pending <- *pendingVerifications
1939 pending <- *pendingVerifications
1940 let same = \p -> p.scope == scope && p.token == token
1940 let same = \p -> p.scope == scope && p.token == token
1941 let match = any pending (\p -> same p && t - p.createdAt < verificationTokenExpiry)
1941 let match = any pending (\p -> same p && t - p.createdAt < verificationTokenExpiry)
1942− when match *pendingVerifications = removeWhere pending same
1942+ when match (*pendingVerifications = removeWhere pending same)
1943 yield match)
1943 yield match)
1944 yield (respond {ok: found})
1944 yield (respond {ok: found})
1945
1945