Skip to content

Conversation

@chrisbobbe
Copy link
Collaborator

This code had a switch/case on the Narrow type, so I discovered it while implementing keyword-search narrows.

We support Zulip Server 7 and later (see README) and refuse to connect to older servers. Since we haven't been using this protocol for servers FL 155+, this should be NFC for all servers we connect to, as long as we know their feature level accurately.

Related: #992

@chrisbobbe chrisbobbe requested a review from rajveermalviya July 2, 2025 22:53
@chrisbobbe chrisbobbe added a-api Implementing specific parts of the Zulip server API maintainer review PR ready for review by Zulip maintainers labels Jul 2, 2025
@chrisbobbe chrisbobbe requested a review from gnprice July 3, 2025 19:33
@chrisbobbe chrisbobbe 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 Jul 3, 2025
@chrisbobbe
Copy link
Collaborator Author

Bumping to integration review, given this should be low-risk (removing code that's dead as long as we have accurate FLs) and would help toward search, #1662.

Comment on lines -31 to -32
final useLegacy = store.zulipFeatureLevel < 155; // TODO(server-6)
if (useLegacy) {
Copy link
Member

Choose a reason for hiding this comment

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

We support Zulip Server 7 and later (see README) and refuse to
connect to older servers. Since we haven't been using this protocol
for servers FL 155+, this should be NFC for all servers we connect
to, as long as we know their feature level accurately.

I think this can be a bit stronger: it's just NFC.

The condition on these lines is based on the zulipFeatureLevel we have. If that feature level were below our supported threshold, we wouldn't have gotten to this point: UpdateMachine.load would have (caught and re-)thrown _ServerVersionUnsupportedException, rather than getting as far as constructing a PerAccountStore. So this feature level is always at least 185, and this condition is always false.

Because this is false, the rest of the affected lib/ code is dead (except from tests), so the change is NFC.

Copy link
Member

Choose a reason for hiding this comment

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

I guess more specifically it's NFC in the actual app (where the store comes from UpdateMachine.load), though not in tests: we have various tests that construct stores with older zulipFeatureLevel, pending #992 and similar cleanups.

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 this up! The changes all look good; one comment below.

This code had a switch/case on the Narrow type, so I discovered it
while implementing keyword-search narrows.

We support Zulip Server 7 and later (see README) and refuse to
connect to older servers. Since we haven't been using this protocol
for servers FL 155+, this is NFC.

Related: zulip#992
@chrisbobbe chrisbobbe force-pushed the pr-remove-legacy-mark-read-protocol branch from 8b5ed9b to 898d907 Compare July 3, 2025 21:33
@chrisbobbe
Copy link
Collaborator Author

Thanks! Revision pushed.

@gnprice gnprice merged commit 898d907 into zulip:main Jul 3, 2025
1 check passed
@gnprice
Copy link
Member

gnprice commented Jul 3, 2025

Thanks! Looks good; merging.

@chrisbobbe chrisbobbe deleted the pr-remove-legacy-mark-read-protocol branch July 3, 2025 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a-api Implementing specific parts of the Zulip server API 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.

2 participants