Remove unsupported notifications from ac notification data#22595
Remove unsupported notifications from ac notification data#22595ajayesivan wants to merge 2 commits intostatus-im:developfrom
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)
|
Parveshdhull
left a comment
There was a problem hiding this comment.
Working perfectly (video), Thank you @ajayesivan
88% of end-end tests have passedFailed 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:
|
| :<- [:activity-center/notifications] | ||
| (fn [notifications] | ||
| (->> notifications | ||
| (filter #(types/all-supported (:type %)))))) |
There was a problem hiding this comment.
Minor detail: the thread macro is unnecessary with just one transformation.
There was a problem hiding this comment.
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.
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.
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.
@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
ulisesmac
left a comment
There was a problem hiding this comment.
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: