From 7b4e338c0eb53b9ce9ba981759abff53aa94d261 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 1 Jun 2022 12:00:05 +1000 Subject: [PATCH] FIX: fallback to default push notification icon if none exists (#16961) Due to some changes we started notifying via push notifications on other families of notifications. There are a total of about 30 or so possible notification you could get, some can be pushed. This fallback means that if for any reason we are unable to find an icon for a push notification we just fallback to the Discourse logo. Also go with a simple reply icon for watching first post. Note, that in production `image_url` can return an exception if an image is missing. This is not the case in test / development. --- .../push-notifications/watching_first_post.png | Bin 0 -> 2081 bytes app/services/push_notification_pusher.rb | 11 ++++++++++- spec/services/push_notification_pusher_spec.rb | 14 ++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 app/assets/images/push-notifications/watching_first_post.png diff --git a/app/assets/images/push-notifications/watching_first_post.png b/app/assets/images/push-notifications/watching_first_post.png new file mode 100644 index 0000000000000000000000000000000000000000..752e25c78d8dc90cd1646290d519258d153d0730 GIT binary patch literal 2081 zcmY+E3pmsJAIC?ArR9=^(>aQkRI8NBjB;N%{N=j;HcA}k7^y$z5$9z56?2;z+gy`N zb(Z1GrB2I{Lm^9>TcyJ36d_8I!^rvS_dI)?&-3iP*Z1>ze?FgQ-`}1e!_&hVx%r#T zFc=K!>f+=LzB%h3)lERvMw2Blm|~o#yD#4PygQT0EG#U{{TcvRUjsUVQdU+L#6UqM zFE0-$lqo1EfEZ|IW~SVhlam7&QVxf6<;oSP7fb^Hx*z~uAmjr9LlZy-1k?iQSL1qB z4s<#l@Y>qiMjMobJU~GS3TPT&XfFWB!)CJ~fJ%Hme`Bwl0RRJZGhl+eWg|c<7z_qv zmahQE^&hk0(!f#>AOk#HE*IPqGzW4*3QExJfn$DtK2VT>S|EnzLkeYpg4pQE&dvrI zxf24&AZN$`R%~osAN23%B0mC<4_r5~Sn@{+<)I`{aFk~N$Ze3JwxGfo{1K(G-X13fYUuG zb9?g%Ifc8~$TB~keQM|VtqVQxjSrq!+KvvnK6T`lcNF5rU)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