Skip to content

Conversation

@sm-sayedi
Copy link
Collaborator

@sm-sayedi sm-sayedi commented Oct 30, 2025

This will be good to have for the second part of #124 (which will be topic-link autocomplete), as well. Specifically, how far back we will want to look for a topic-link autocomplete interaction.

Fixes: #307

@sm-sayedi sm-sayedi added the maintainer review PR ready for review by Zulip maintainers label Oct 30, 2025
@sm-sayedi sm-sayedi requested a review from chrisbobbe October 30, 2025 18:27
Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good except for one nit below, and I'll mark this for Greg's review.

bool get realmEnableReadReceipts;
bool get realmMandatoryTopics;
int get maxFileUploadSizeMib;
int get maxTopicLength;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Searching for "max_topic_length" at https://zulip.com/api/get-events , I think this one isn't updated by the realm/update_dict event, and it belongs in the "Realm settings that lack events." section.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch. Probably good to mention that in the thread #issues > Resolve-unresolve can lose information @ 💬 — we might start sending an event if it turns into a real realm setting.

@chrisbobbe chrisbobbe requested a review from gnprice November 1, 2025 01:09
@chrisbobbe chrisbobbe assigned gnprice and unassigned chrisbobbe Nov 1, 2025
@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 Nov 1, 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 @sm-sayedi for taking care of this, and @chrisbobbe for the previous review!

It turns out this is a very timely issue 🙂 — just today we decided we might want to actually change this value on the server side sometime soon: #issues > Resolve-unresolve can lose information @ 💬.

Small comments below, in addition to Chris's comment above.

realmMandatoryTopics: mandatoryTopics,
realmAllowMessageEditing: true,
realmMessageContentEditLimitSeconds: null,
maxTopicLength: maxTopicLength
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
maxTopicLength: maxTopicLength
maxTopicLength: maxTopicLength,

expectedMessage: 'Topic length shouldn\'t be greater than $maxTopicLength ${maxTopicLength == 1 ? 'character' : 'characters'}.')));
}

final variants = ValueVariant({30, 60, 90});
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 it's not necessary to run each of these test cases in triplicate with different lengths.

Instead, pick just one value — but make it some number that isn't the historical default (60) and isn't a round number. E.g., 37.

(If we wanted the test to be a bit more paranoid, we could use two different values. But I'm content with just one, and counting on the implementation to not have a hard-coded value that just happens to match the odd value chosen in the test.)

Comment on lines 433 to 442
await prepareWithTopic(tester,
makeStringWithCodePoints(kMaxTopicLengthCodePoints + 1));
final maxTopicLength = variants.currentValue!;
await prepareWithTopic(tester, makeStringWithCodePoints(maxTopicLength + 1),
maxTopicLength: maxTopicLength);
Copy link
Member

Choose a reason for hiding this comment

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

Another consequence of that approach is that these test bodies can avoid getting any more complex than they were: just instead of saying kMaxTopicLengthCodePoints, they say maxTopicLength, where that's a local constant in this group body.

@sm-sayedi sm-sayedi force-pushed the 307-max-topic-length branch from 8fd5628 to cc98cf8 Compare November 1, 2025 03:30
@sm-sayedi
Copy link
Collaborator Author

Thanks @chrisbobbe and @gnprice for the reviews. Revision pushed.

@sm-sayedi sm-sayedi requested a review from gnprice November 1, 2025 03:33
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.

Use max_topic_length instead of hardcoded limit of 60

3 participants