# Bug in spoiler iOS notifications

**URL:** https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825
**Category:** Bug
**Created:** [April 9, 2019, 3:59am UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825 "2019-04-09T03:59:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [April 9, 2019, 3:59am UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825/1 "2019-04-09T03:59:54Z")

</div>

There’s a bug in the way the Discourse Hub iOS app handles spoilers; it shows the spoiler text in the clear.

To reproduce: Install the Discourse Hub iOS app, sign in to a forum, and sign up for notifications.

Use a separate account to send yourself a private message containing a blurred spoiler, like this. You’ll receive a push notification of the PM.

Actual:

 ![IMG_0418](https://global.discourse-cdn.com/meta/original/3X/5/f/5f2d3193ae4043deebdcc8e36541bcca9caa9165.png)

Expected: The spoiler text should be concealed.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [April 9, 2019, 4:00am UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825/2 "2019-04-09T04:00:29Z")

</div>

I _think_ this is a regression, but I’m not 100% sure of it.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [April 10, 2019, 1:55am UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825/4 "2019-04-10T01:55:39Z")

</div>

I’m going to look into this since I am doing some other work around iOS and push notifications.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 10, 2019, 6:48am UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825/5 "2019-04-10T06:48:19Z")

</div>

I think it comes from our excerpt parser that is being called here

> <https://github.com/discourse/discourse/blob/b58867b6e936a5247304e9f06f827cf5012a92ed/app/services/post_alerter.rb#L432>

We have some code to preserve spoilers but I don’t know why we did that and it seems like a bad idea

> <https://github.com/discourse/discourse/blob/b58867b6e936a5247304e9f06f827cf5012a92ed/lib/excerpt_parser.rb#L111-L115>

We should be replacing the whole spoiler with `[spoiler]` like we do for images.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [April 12, 2019, 4:02pm UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825/6 "2019-04-12T16:02:36Z")

</div>

Thanks @zogstrip, that was very helpful. Fixed in [FIX: strip spoilers in notification excerpts · discourse/discourse@5594222 · GitHub](https://github.com/discourse/discourse/commit/55942224ed9d3329113e0060b7726bb53f648433)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 12, 2019, 11:14pm UTC](https://meta.discourse.org/t/bug-in-spoiler-ios-notifications/113825/7 "2019-04-12T23:14:36Z")

</div>


