Skip to content

Commit 6c532de

Browse files
committed
api [nfc]: Describe getSingleMessage error cases more explicitly
In particular make it clear that while this function can return void, that is not what it does in the case where the message doesn't exist. (Based on going and reading the linked server API doc.)
1 parent 6a6409d commit 6c532de

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/messages/getSingleMessage.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ type ServerApiResponseSingleMessage = {|
2222
/**
2323
* See https://zulip.com/api/get-message
2424
*
25-
* Gives undefined if the `message` field is missing, which it will be for
26-
* FL <120.
25+
* Throws an error if the message doesn't exist at all, or isn't visible to
26+
* our user.
27+
*
28+
* Otherwise, gives undefined on old servers (FL <120) where this API
29+
* endpoint doesn't return a `message` field.
2730
*/
2831
// TODO(server-5.0): Simplify FL-120 condition in jsdoc and implementation.
2932
export default async (

0 commit comments

Comments
 (0)