From 8376acb3b83588bc38092bca51c85b0000693f38 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 4 Mar 2022 11:53:13 -0800 Subject: [PATCH] edit_history: Add comments detailing when user_id can be null. This is already in the API documentation, but I think it's worth having here. --- zerver/lib/types.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zerver/lib/types.py b/zerver/lib/types.py index a765ab0adf..f1ef411ba4 100644 --- a/zerver/lib/types.py +++ b/zerver/lib/types.py @@ -96,6 +96,10 @@ class EditHistoryEvent(TypedDict, total=False): Database format for edit history events. """ + # user_id is null for precisely those edit history events + # predating March 2017, when we started tracking the person who + # made edits, which is still years after the introduction of topic + # editing support in Zulip. user_id: Optional[int] timestamp: int prev_stream: int @@ -112,6 +116,7 @@ class FormattedEditHistoryEvent(TypedDict, total=False): Extended format used in the edit history endpoint. """ + # See EditHistoryEvent for details on when this can be null. user_id: Optional[int] timestamp: int prev_stream: int