Skip to content

Conversation

chrisbobbe
Copy link
Collaborator

Fixes #1837.

This isn't our most urgent issue, but I was looking for some low-hanging fruit I could clear during yesterday's heat wave when it was really hot and uncomfortable at home. :)

@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label Sep 24, 2025
@chrisbobbe chrisbobbe force-pushed the pr-clear-todo-server-6 branch from f29237b to 4a8cebc Compare September 26, 2025 20:38
Copy link
Member

@rajveermalviya rajveermalviya left a comment

Choose a reason for hiding this comment

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

Thanks @chrisbobbe! LGTM, moving over to Greg's review.

@rajveermalviya rajveermalviya added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Sep 30, 2025
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 cleaning these up! Generally all looks good. A few comments below.

In addition to the TODO-server comments in our code, I also took this as a prompt to read through the API changelog https://zulip.com/api/changelog for Server 6. Items I found there which should also be part of relying on Server 6:

  • FL-139: no more in_home_view in subscription/update events
  • FL-148: no more away in user status, which we had commented out

Also grepped -i for server.?6 at the tip of the branch; the only match was that FL-148 removal of away.

final UserSettings userSettings;

final List<UserTopicItem>? userTopics; // TODO(server-6)
final List<UserTopicItem> userTopics;
Copy link
Member

Choose a reason for hiding this comment

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

This replaced muted_topics. Grepping (with git grep -i muted.?topic`), we have a commented-out reference to that, above, which we can delete.

Also a comment in the list of event types.

GetMessagesResult olderGetMessagesResult({
required int anchor,
bool foundAnchor = false, // the value if the server understood includeAnchor false
bool foundAnchor = false,
Copy link
Member

Choose a reason for hiding this comment

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

This should mean we can drop this parameter, right? And just hard-code the value in this test helper's body. (Because we no longer need to exercise scenarios where it has any other value.)

Comment on lines 534 to 538
topics.update(topic,
ifAbsent: () => messageIds,
// setUnion dedupes existing and incoming unread IDs,
// so we tolerate zulip/zulip#22164, fixed in 6.0
// TODO(server-6) remove 6.0 comment
(existing) => setUnion(existing, messageIds),
);
(existing) => setUnion(existing, messageIds));
}

Copy link
Member

Choose a reason for hiding this comment

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

This comment appears to have been explaining why we had this setUnion. Do we no longer need it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We discussed this in the office and decided to keep it, because it ensures the result is sorted when existing and messageIds are disjoint.

@chrisbobbe chrisbobbe force-pushed the pr-clear-todo-server-6 branch from 4a8cebc to 0d63468 Compare October 3, 2025 23:17
@chrisbobbe
Copy link
Collaborator Author

Thanks for the review! Revision pushed.

@gnprice
Copy link
Member

gnprice commented Oct 3, 2025

Thanks!

  • FL-148: no more away in user status, which we had commented out

This small piece is still open.

One nit here:

[…] This change
prepares for that by gracefully ignoring
SubscriptionProperty.unknown, which will be how in_home_view gets
represented.

This change doesn't ignore .unknown, AFAICS — it causes .unknown to get emitted, and then we already ignore it.

Otherwise all LGTM.

@chrisbobbe chrisbobbe force-pushed the pr-clear-todo-server-6 branch from 0d63468 to 04595cd Compare October 4, 2025 00:06
@chrisbobbe
Copy link
Collaborator Author

Ah yep, thanks for those catches. Revision pushed!

Issue zulip#992 was closed as a duplicate of zulip#1837, and zulip#1838 exists as
the issue for TODO(server-7) comments.
The doc for this says
> This field is only included when its value is `true`.
so the TODO(server-6) isn't reason enough to make it a required
field.

Fixes-partly: zulip#1837
This isn't a case of special backward-compat code to be trimmed out;
the backwards compatibility was simply that older servers wouldn't
exercise this code.

Fixes-partly: zulip#1837
Our event poll shouldn't crash on subscription/update events about
data that we don't store and act on. This bugfix allows servers to
add new Subscription fields and send corresponding events without
causing the app to discard its data and reregister a new event
queue.

Soon, for zulip#1837, we'd like to remove
SubscriptionProperty.inHomeView, which was deprecated in FL 139.
Events with in_home_view are still sent by modern servers (as of CZO
2025-10-03), but we never need them because they always come with an
is_muted event. Now, when we remove SubscriptionProperty.inHomeView,
the in_home_view event will parse instead of not parsing, and it'll
have SubscriptionProperty.unknown for `property`, which the store
already ignores.
See changelog for FL 139:

`GET /get-events`: When a user mutes or unmutes their subscription
  to a stream, a `subscription` update event is now sent for the
  `is_muted` property and for the deprecated `in_home_view` property
  to support clients fully migrating to use the `is_muted` property.
  Prior to this feature level, only one event was sent to clients
  with the deprecated `in_home_view` property.

Fixes-partly: zulip#1837
@chrisbobbe chrisbobbe force-pushed the pr-clear-todo-server-6 branch from 04595cd to 6adc9c3 Compare October 4, 2025 00:35
@chrisbobbe
Copy link
Collaborator Author

Thanks, revision pushed!

@gnprice
Copy link
Member

gnprice commented Oct 4, 2025

Thanks! Looks good; merging.

(The last revision was adjusting commit-message summary lines to use the prefix "api:", following a conversation in the office.)

@gnprice gnprice merged commit 6adc9c3 into zulip:main Oct 4, 2025
1 check passed
@chrisbobbe chrisbobbe deleted the pr-clear-todo-server-6 branch October 7, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when PR may be ready for integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rely on Zulip Server 6 APIs
3 participants