on master help sign in
Remove unused /messages/status endpoint
commit18383840c6b79b4f177571ebc40fcd5719144823 authoriko <mail@iko.soy> dateThu 7 May 2026, 21:52 (5 months ago) parentbea680e
1 file changed+1−20
server.knot+1−20
server.knot+1−20
@@ -377,7 +377,7 @@ type ActivePoll = {pubkey: PubkeyHex, startedAt: Timestamp}
377377-- ============================================
378378-- Public HTTP surface, grouped by audience:
379379-- AuthApi -- challenge/verify (client identity)
380−-- ClientApi -- /poll, /messages (send), /messages/status, presence lookup
380+-- ClientApi -- /poll, /messages (send), presence lookup
381381-- FederationApi -- inter-server gossip, forward (single + batch)
382382-- FederationPubkey -- exposes this server's federation Ed25519 public key
383383-- MaintenanceApi -- operator endpoints (prune, peer allow/block, admin)
@@ -392,7 +392,6 @@ route AuthApi where
392392route ClientApi where
393393 POST {cursor: Timestamp, generation: Int} /poll headers {authorization: Text, clientIp: Text} -> {events: [PollEvent], cursor: Timestamp, authorized: Bool, rateLimited: Bool, generation: Int, heartbeat: Bool, retryAfterMs: Int, cursorReset: Bool, hasMore: Bool, cursorStale: Bool, loadPct: Int} = Poll
394394 POST {messages: [{to: PubkeyHex, encryptedBlob: BlobHex}]} /messages headers {authorization: Text, clientIp: Text} -> {results: [{messageId: MessageIdHex, error: Text}], error: Text, retryAfterMs: Int} = SendMessages
395− POST {to: PubkeyHex, messageId: MessageIdHex} /messages/status headers {authorization: Text, clientIp: Text} -> {status: Text, authorized: Bool} = MessageStatus
396395 GET /lookup/{pubkey: PubkeyHex} headers {authorization: Text, clientIp: Text} -> {server: ServerName, authorized: Bool, error: Text} = LookupPresence
397396 POST {pubkeys: [PubkeyHex]} /lookup/batch headers {authorization: Text, clientIp: Text} -> {results: [{pubkey: PubkeyHex, server: ServerName}], authorized: Bool, error: Text} = BatchLookupPresence
398397
@@ -1454,23 +1453,6 @@ handleBatchLookupPresence = \pubkeys authorization clientIp -> do
14541453 let results = pluck (takeRelation 50 pubkeys) (\k -> {pubkey: k, server: maskedServer pres k t})
14551454 yield {results, authorized: True {}, error: ""})
14561455
1457−-- POST /messages/status: classify a message as
1458−-- pending (in mailbox), forwarding (en-route to a peer), or unknown.
1459−-- A message that has been polled and removed returns "unknown"; the server
1460−-- keeps no post-delivery record, so the client must track delivery itself.
1461−handleMessageStatus : PubkeyHex -> MessageIdHex -> Text -> Text -> IO {rw *globalRateCount, rw *globalRateWindowStart, r *sessions, clock} {authorized: Bool, status: Text}
1462−handleMessageStatus = \to messageId authorization clientIp -> do
1463− t <- now
1464− let mkErr = \_ -> {status: "", authorized: False {}}
1465− gateAuth authorization clientIp t mkErr (\_ -> do
1466− msgs <- *messages
1467− fwds <- *forwards
1468− let blobMatches = \x -> messageIdOf x.encryptedBlob == messageId && x.toKey == to
1469− let s = if any msgs blobMatches
1470− then "pending"
1471− else if any fwds blobMatches then "forwarding" else "unknown"
1472− yield {status: s, authorized: True {}})
1473−
14741456-- ============================================
14751457-- Handler: federation receive
14761458-- ============================================
@@ -2178,7 +2160,6 @@ api = serve Api where
21782160 VerifyAuth = \{pubkey, challenge, signature, revokeOthers, clientIp} -> handleVerifyAuth pubkey challenge signature revokeOthers clientIp
21792161 Poll = \{cursor, generation, authorization, clientIp} -> handlePoll cursor generation authorization clientIp
21802162 SendMessages = \{messages, authorization, clientIp} -> handleSendMessages messages authorization clientIp
2181− MessageStatus = \{to, messageId, authorization, clientIp} -> handleMessageStatus to messageId authorization clientIp
21822163 LookupPresence = \{pubkey, authorization, clientIp} -> handleLookupPresence pubkey authorization clientIp
21832164 BatchLookupPresence = \{pubkeys, authorization, clientIp} -> handleBatchLookupPresence pubkeys authorization clientIp
21842165 RecvGossip = \{events, fromServer, requestTimestamp, authorization} -> handleRecvGossip events fromServer requestTimestamp authorization