Skip to content

action types: Sync update-message event type with doc #5155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2021

Conversation

chrisbobbe
Copy link
Contributor

This should help with #4840. Inheriting P1 from that issue.

@chrisbobbe chrisbobbe added a-data-sync Zulip's event system, event queues, staleness/liveness P1 high-priority labels Dec 7, 2021
@chrisbobbe chrisbobbe requested a review from gnprice December 7, 2021 01:34
@chrisbobbe
Copy link
Contributor Author

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this! Small comments below.

// TODO is it really right that just one of the orig_* is optional?
orig_content: string,

// TODO: The doc for this field isn't yet correct; it turns out that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second TODO is resolved with Tim's clarifications in in
8295bb918.

Let's clarify what repo that commit ID is in, like zulip/zulip@8295bb918.

Comment on lines 345 to 347
// This is current to feature level 109.
type EventUpdateMessageAction = {|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a good occasion to add a link to the API doc. (Which didn't exist when this type was first written down.)

Comment on lines 343 to 347
|};
type TopicLinks = $ReadOnlyArray<{| +text: string, +url: string |}> | $ReadOnlyArray<string>;
// This is current to feature level 109.
type EventUpdateMessageAction = {|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: blank line between these definitions

(Not sure why there wasn't one between the existing two; seems like an oversight.)

Comment on lines 360 to 366
// TODO(server-3.0): Added in feat. 46, replacing subject_links
// TODO(server-4.0): Changed in feat. 1 to array-of-objects shape, from string[]
topic_links?: TopicLinks,

// TODO(server-3.0): Replaced in feat. 46 by topic_links
// TODO(server-4.0): Changed in feat. 1 to array-of-objects shape, from string[]
subject_links?: TopicLinks,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the feature levels here are swapped.

Also, as I read the doc, subject_links stops existing after the rename; it's not simultaneously present e.g. for compatibility. So when present, it's always the old form.


// TODO(server-3.0): Added in feat. 46, replacing subject_links
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this TODO can be dropped, because there's not actually anything to do at this spot when dropping support for these old servers: the field is optional even in the latest version.

@gnprice
Copy link
Member

gnprice commented Dec 8, 2021

Oh, and on the partial version of this that's in #4980 I see there's one other comment that's relevant here: #4980 (comment)

(Plus #4980 (comment) , which I covered above but more tersely.)

@chrisbobbe chrisbobbe force-pushed the pr-update-message-action-type-sync branch from 102c0f0 to 772fc52 Compare December 8, 2021 00:26
@chrisbobbe
Copy link
Contributor Author

chrisbobbe commented Dec 8, 2021

Thanks for the review, revision pushed!

Please note this before merge:

See two currently unresolved questions at https://chat.zulip.org/#narrow/stream/378-api-design/topic/.60update_message.60.20event/near/1292941 .

@chrisbobbe
Copy link
Contributor Author

chrisbobbe commented Dec 8, 2021

Confirmed in chat that we should expect message_ids to always be present; I intend to include that in my docs PR to resolve those other two questions.

@gnprice gnprice force-pushed the pr-update-message-action-type-sync branch from 772fc52 to 4ce9e20 Compare December 8, 2021 00:37
@gnprice gnprice merged commit 4ce9e20 into zulip:main Dec 8, 2021
@gnprice
Copy link
Member

gnprice commented Dec 8, 2021

Thanks! This looks good -- merging.

Those two unresolved questions look to not affect these types, because they're both about the conditions under which a particular optional field is or isn't present; the fields are optional regardless.

@chrisbobbe chrisbobbe deleted the pr-update-message-action-type-sync branch December 9, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-data-sync Zulip's event system, event queues, staleness/liveness P1 high-priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants