-
Notifications
You must be signed in to change notification settings - Fork 1k
Remove unsupported notifications from ac notification data #22595
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
base: develop
Are you sure you want to change the base?
Remove unsupported notifications from ac notification data #22595
Conversation
@ilmotta @flexsurfer @ulisesmac @Parveshdhull Whenever you have a moment, could you please review this PR? Thanks in advance! |
Jenkins BuildsClick to see older builds (8)
|
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.
Working perfectly (video), Thank you @ajayesivan
88% of end-end tests have passed
Failed tests (3)Click to expandClass TestWalletCollectibles:
Class TestWalletMultipleDevice:
Passed tests (21)Click to expandClass TestWalletCollectibles:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestWalletMultipleDevice:
Class TestCommunityOneDeviceMerged:
Class TestWalletOneDeviceTwo:
Class TestProfileMultipleDevices:
Class TestCommunityMultipleDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestWalletCustomParamOneDevice:
Class TestWalletOneDevice:
|
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.
Nice fix 💯
:<- [:activity-center/notifications] | ||
(fn [notifications] | ||
(->> notifications | ||
(filter #(types/all-supported (:type %)))))) |
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.
Minor detail: the thread macro is unnecessary with just one transformation.
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.
Yep, I used it because it felt a bit clearer to me. But if you prefer removing the macro, I’m happy to update 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.
It tends to be seen as superfluous in my experience from other Clojure repos. In the CSG https://guide.clojure.style/#threading-macros there's a recommendation to use it to reduce heavy nesting. I've seen most Clojure code tends to use the thread macros when there are two or more transformations (but it's not a rule).
If you add a line to separate the transformation it can look clean.
(filter #(types/all-supported (:type %))
notifications)
Or if you create a predicate it looks cleaner:
(filter supported-notification? notifications)
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.
Thank you, @ilmotta, for the explanation. I think the last approach is the best one, and I’ve updated the code accordingly.
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.
@ilmotta This is something I've seen multiple times in our repo: using threading macros with only one step. As you said, it's not a rule but is superfluous.
4610920
to
62783d6
Compare
a3ed6cb
to
7fcf83d
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.
Looks fine! Thanks @ajayesivan 👍
fix #22418
Summary
There are several notification types that are not yet supported on mobile. When unsupported notifications are present in the notification data, this was causing a AC 'all' tab blank state.
This PR filters out unsupported notification types and renders only the supported ones to avoid this issue.
See the issue for the complete discussion.
Risk
Described potential risks and worst case scenarios.
Tick one: