-
Notifications
You must be signed in to change notification settings - Fork 313
Distinguish a TopicName type from plain String #1266
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
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
431ef8a
api: Explicitly ignore topics on DMs
gnprice 02002ed
autocomplete: Simplify updating input on topic autocomplete
gnprice f4783f1
compose [nfc]: Abstract out ComposeTopicController.setTopic
gnprice 15cc6ba
test [nfc]: Centralize a helper eg.unreadChannelMsgs
gnprice dcf3e40
api [nfc]: Introduce TopicName extension type
gnprice 141c359
test [nfc]: Add an "eg.t" helper to make a TopicName; use it
gnprice 6c19203
test [nfc]: Add a helper eg.topicNarrow; use it
gnprice 28945cd
test [nfc]: Accept TopicName when constructing example move events
gnprice 688b2e5
test [nfc]: Explicitly convert various other topics to TopicName
gnprice d05f5df
test [nfc]: Leave a few topics as explicit strings
gnprice f008a95
api [nfc]: Use TopicName in initial-snapshot types
gnprice c769307
api [nfc]: Use TopicName in event types
gnprice 846fec8
api [nfc]: Use TopicName in one remaining result type
gnprice 4f8e933
api [nfc]: Use TopicName type in decoding message edit history
gnprice 78ad40e
api [nfc]: Use TopicName type in an API-interpreting static method
gnprice 3ba4cf7
api [nfc]: Use TopicName in notification types
gnprice 909040c
model [nfc]: Use TopicName type across our model code
gnprice cd5f4a5
api [nfc]: Use TopicName type in ApiNarrow
gnprice 9e97109
api [nfc]: Use TopicName type across request parameters
gnprice fca6fb1
api [nfc]: Introduce TopicName.apiName, and use for making API requests
gnprice 9ddd691
api [nfc]: Use TopicName.apiName for constructing narrow links
gnprice 6973bbc
api [nfc]: Use TopicName.apiName for identifying resolve/unresolve moves
gnprice 91c087c
notif [nfc]: Use TopicName.apiName for encoding NotificationOpenPayload
gnprice 1e5d2a3
api [nfc]: Factor out TopicName.canonicalize
gnprice fe554f9
notif: Case-fold topics for grouping conversations
gnprice 77b7f75
api [nfc]: Introduce TopicName.displayName, and use where needed
gnprice 23d84fb
api [nfc]: Seal the TopicName migration by making non-transparent
gnprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah. One way this PR is helpful is by making it easy to find topic-keyed maps, where we're being incorrectly case-sensitive 🙂 with
git grep 'Map<TopicName,'
Unreads.streams
(tracked as Case-insensitive topics in unreads data #980)ChannelStoreImpl.topicVisibility
(no issue yet!)RecentSenders.topicSenders
(no issue yet!)Do you know if we can make a nice drop-in replacement for
Map<TopicName, …>
that uses the canonicalized form ofTopicName
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is handy.
Yeah. I think we'll want a class with a name like
TopicMap
, which maybe even implementsMap<TopicName, …>
. Its implementation will resemble web'sFoldDict
:https://github.com/zulip/zulip/blob/e963d5eaa9d73faa31b9c9e1463a2ac0a5169e7a/web/src/fold_dict.ts