-
-
Notifications
You must be signed in to change notification settings - Fork 674
narrow/recipient: Fix more bugs, and prep for bigger refactors #4332
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
13 commits
Select commit
Hold shift + click to select a range
0b9d381
logging [nfc]: Stop importing store, by injecting the dependency.
gnprice 095a9af
tests [nfc]: Set up mocks for `logging` module.
gnprice 7ee176d
recipient: Add error logging for malformed-email fudges in "normalize".
gnprice 82d3ce3
recipient: Fix normalizeRecipientsAsUserIds to sort properly.
gnprice 5d698d2
notif: Sort user IDs correctly in pm_users.
gnprice 5f6b18a
recipient: Collect all copies of "PM key recipients" filter logic.
gnprice 46a7ac7
recipient [nfc]: Simplify out extra recipient-alikes for typing status.
gnprice beebad5
narrow [nfc]: Clarify that pmNarrowFromEmails is for 1:1 PMs too.
gnprice 9956548
narrow [nfc]: Simplify out a redundant conditional in msglist HTML lo…
gnprice 7c1ad0f
internalLinks [nfc]: Drop some unused parameters.
gnprice 9ba8e44
recipient: Fix some places that wrongly ignored bots and deactivated …
gnprice 30e2a79
presence: Use complete users data structure, from getAllUsersByEmail.
gnprice 2a03ba6
narrow [nfc]: Fix a comment reference to getNarrowForReply.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /** | ||
| * A dead-drop for select data to be included in log events. | ||
| * | ||
| * More precisely, for a getter for that data; this way we don't have to be | ||
| * constantly updating it, as we would if this module contained a copy of | ||
| * the data itself. | ||
| * | ||
| * This arrangement provides a way for the logging code to get this | ||
| * information without having to import the Redux store. Otherwise we tend | ||
| * to get nasty import cycles, because logging is naturally low in the | ||
| * import graph (imported by lots of other modules) and the app's Redux | ||
| * store is naturally high in the import graph (importing lots of other | ||
| * modules). | ||
| * | ||
| * @flow strict-local | ||
| */ | ||
| import type { ZulipVersion } from '../utils/zulipVersion'; | ||
|
|
||
| type LoggingContext = {| | ||
| serverVersion: ZulipVersion | null, | ||
| |}; | ||
|
|
||
| let getter: (() => LoggingContext) | null = null; | ||
|
|
||
| /** | ||
| * The logging context, or null if none is available. | ||
| * | ||
| * The null case should only happen if we haven't even finished importing | ||
| * our code yet, in particular the code that provides the Redux store. | ||
| */ | ||
| export const getLoggingContext = (): LoggingContext | null => getter && getter(); | ||
|
|
||
| /** | ||
| * Set the getter for the logging context. | ||
| * | ||
| * This is called once at startup, after the Redux store is created. | ||
| */ | ||
| // Effectively the getter will contain: | ||
| // * a reference to the Redux store, to get the state; | ||
| // * references to some selectors, to pick the relevant data out of the | ||
| // Redux state. | ||
| // We don't want the logging code to have to know about either of those, | ||
| // lest we create import cycles. So the getter's implementation lives | ||
| // completely elsewhere and gets injected here. | ||
| export const provideLoggingContext = (newGetter: () => LoggingContext) => { | ||
| getter = newGetter; | ||
| }; | ||
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
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
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
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
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
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
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
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
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
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
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.
0b9d381 logging [nfc]: Stop importing store, by injecting the dependency.
Interesting!