Bug in spoiler iOS notifications

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:

Expected: The spoiler text should be concealed.

6 Likes

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

3 Likes

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

9 Likes

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.

10 Likes

Thanks @zogstrip, that was very helpful. Fixed in https://github.com/discourse/discourse/commit/55942224ed9d3329113e0060b7726bb53f648433

7 Likes