Skip to content

Conversation

evykassirer
Copy link
Collaborator

There are a handful of things I made assumptions about that I need to check, one of which is related to a failing test, but opening this as a draft for now in case anyone wants to take a first pass review on it.

@evykassirer evykassirer added the area: typescript migration Issues for migrating Zulip to TypeScript label Nov 27, 2024
@evykassirer evykassirer force-pushed the message-events-typescript branch from 8ee4c56 to 5cd85f9 Compare November 29, 2024 00:46
@evykassirer
Copy link
Collaborator Author

Made the changes Anders suggested, though the PR description is still accurate.

@evykassirer evykassirer force-pushed the message-events-typescript branch from 5cd85f9 to f0c9ac7 Compare December 6, 2024 00:43
@evykassirer evykassirer force-pushed the message-events-typescript branch from f0c9ac7 to b646054 Compare December 6, 2024 00:54
@evykassirer evykassirer marked this pull request as ready for review December 6, 2024 00:55
@evykassirer evykassirer requested a review from andersk December 6, 2024 03:10
Comment on lines 46 to 48
function filter_has_term_type(filter: Filter | undefined, term_type: string): boolean {
return (
filter !== undefined &&
Copy link
Member

Choose a reason for hiding this comment

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

Accepting Filter | undefined here has no advantage; every caller either passes a defined Filter or has to later check for undefined anyway.

Suggested change
function filter_has_term_type(filter: Filter | undefined, term_type: string): boolean {
return (
filter !== undefined &&
function filter_has_term_type(filter: Filter, term_type: string): boolean {
return (

Comment on lines +171 to +172
assert(first_message !== undefined);
const first_id = first_message.id;
const last_message = msg_list.last();
assert(last_message !== undefined);
Copy link
Member

Choose a reason for hiding this comment

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

Do we know these aren’t undefined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If they had been, the previously existing code would have given an error for calling .id on undefined

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I'm not sure the previous code is correct here; @amanagr can investigate as a follow-up.

@evykassirer evykassirer force-pushed the message-events-typescript branch from b646054 to b8232a5 Compare December 7, 2024 06:07
@evykassirer evykassirer requested a review from andersk December 7, 2024 06:08
@andersk andersk added the integration review Added by maintainers when a PR may be ready for integration. label Dec 8, 2024
Accepting an undefined Filter  has no advantage; every caller either
passes a defined Filter or has to later check for undefined anyway.
@evykassirer evykassirer force-pushed the message-events-typescript branch from b8232a5 to b5d14a9 Compare December 9, 2024 22:37
@evykassirer evykassirer requested a review from timabbott December 9, 2024 23:09
prev_stream?: number;
topic?: string;
prev_topic?: string;
} = {
Copy link
Member

Choose a reason for hiding this comment

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

Probably a good follow-up would be to refine this type to be a union of different types of edit history event types used elsewhere in the codebase. EditHistoryEntry is fairly different. Might be appropriate to just leave an issue for this if it seems like work.

@timabbott timabbott merged commit 7bd4016 into zulip:main Dec 10, 2024
15 checks passed
@timabbott
Copy link
Member

Merged, thanks @evykassirer! Pretty excited to have this one merged, since it's one of the last handful of big files, and one of the more logically complex.

@evykassirer evykassirer deleted the message-events-typescript branch December 10, 2024 20:58
evykassirer added a commit to evykassirer/zulip that referenced this pull request Sep 24, 2025
evykassirer added a commit to evykassirer/zulip that referenced this pull request Sep 24, 2025
timabbott pushed a commit that referenced this pull request Sep 25, 2025
karlstolley pushed a commit to karlstolley/zulip that referenced this pull request Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: typescript migration Issues for migrating Zulip to TypeScript integration review Added by maintainers when a PR may be ready for integration. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants