Bug in spoiler iOS notifications

AI-generated summary

A bug has been reported in the Discourse Hub iOS app where spoiler text is displayed in clear in notifications. To reproduce, send a private message with a blurred spoiler, and the spoiler text will be visible in the push notification. The expected behavior is for the spoiler text to be concealed.

dfabulich suspects this might be a regression. pmusaraj is investigating the issue. zogstrip believes the problem lies in the excerpt parser, specifically in the code that preserves spoilers, which seems like a bad idea. The fix would be to replace the whole spoiler with [spoiler], similar to how images are handled. pmusaraj has since fixed the issue in this commit.

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

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

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

10 Likes

Thanks @zogstrip, that was very helpful. Fixed in FIX: strip spoilers in notification excerpts · discourse/discourse@5594222 · GitHub

7 Likes