-
Notifications
You must be signed in to change notification settings - Fork 308
initial_snapshot: Add emailAddressVisibility override in InitialSnapshot method #1011
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
Conversation
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.
Thanks for fixing this! Small commit-message comment below.
@@ -804,7 +804,7 @@ InitialSnapshot initialSnapshot({ | |||
zulipMergeBase: zulipMergeBase ?? recentZulipVersion, | |||
alertWords: alertWords ?? ['klaxon'], | |||
customProfileFields: customProfileFields ?? [], | |||
emailAddressVisibility: EmailAddressVisibility.everyone, | |||
emailAddressVisibility: emailAddressVisibility ?? EmailAddressVisibility.everyone, |
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.
initial_snapshot: Add emailAddressVisibility override in InitialSnapshot method
The InitialSnapshot method does not override the
emailAddressVisibility in the example_data.dart
with the value passed in the function arguments.
This commit fixes the bug
Commit message nit: I think the paragraph ("The InitialSnapshot method…") isn't necessary; it just repeats what's already clear in the code change. Instead of that paragraph, how about:
- "It looks like this was left out by accident." (or something like that)
- Say whether or not any callers were passing
emailAddressVisibility
. That helps make clear what changes this is making to our tests' behavior, if any. (From a quick search, I think none of the callers were passing it.)
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.
Okay, thanks for the comment, I will update the commit message.
Yes, at the moment no callers were passing emailAddressVisibility
, but when I was working on the @mention autocomplete items, I was trying to write a test that required passing the emailAddressVisibility
, that is when I discovered the issue, Even if it is not used now, I think there will be future scenarios where it would be needed.
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.
Makes sense. Yes, this is still a good change to make! :) Just that it's helpful to know if it's a change that affects behavior of existing tests. It sounds like it doesn't, and that's helpful to write down in the commit message, for anyone who's reading it who doesn't know that yet.
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.
Please post on the PR thread when you've made the change and it's ready for another review.
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.
Hi @chrisbobbe
I have made updates to the commit, please review.
dcfc369
to
a82818a
Compare
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.
Thanks! Another commit-message comment on something I missed last time; otherwise looks good to me (LGTM).
@@ -804,7 +804,7 @@ InitialSnapshot initialSnapshot({ | |||
zulipMergeBase: zulipMergeBase ?? recentZulipVersion, | |||
alertWords: alertWords ?? ['klaxon'], | |||
customProfileFields: customProfileFields ?? [], | |||
emailAddressVisibility: EmailAddressVisibility.everyone, | |||
emailAddressVisibility: emailAddressVisibility ?? EmailAddressVisibility.everyone, |
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.
Thanks! And one more thing I missed last time. In the commit message summary line—
initial_snapshot: Add emailAddressVisibility override in InitialSnapshot method
- Keep it to 76 characters or shorter
- Let's use "test:" for the prefix, so it's clear it's purely about test code
- The method's name is
initialSnapshot
, notInitialSnapshot
. Our convention is to import the example-data methods aseg.
, soeg.initialSnapshot
is a compact way to identify the method that's nice and clear that it's an example-data method.
So, how about:
test: Fix eg.initialSnapshot to use emailAddressVisibility override
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.
Okay, thank you. Will update that.
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.
I have updated the commit message
a82818a
to
f8b7119
Compare
Thanks, LGTM! Marking for Greg's review. |
Thanks @fombalang for the fix, and @chrisbobbe for the previous reviews! Looks good; merging. |
I think we forgot this. No callers in the tests currently use this override, but it's probably a good idea to have it properly overriding anyway.
f8b7119
to
ffa41be
Compare
I noticed a bug where the value passed for the
emailAddressVisibility
in theinitialSnapshot
method in theexample_data.dart
file was not being passed down to the class but rather defaulted toEmailAddressVisibility.everyone
even though a different value was passed. When I looked deeper into it, I noticed that they forgot to add the override. This PR adds a fix for that. There isn't an open issue for this yet, so I am unable to link to it.Please review when available.
Thank you.