Keep content warning when editing a post - #1584
Open
thribhuvan003 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1424.
Editing a post that has a content warning publishes it without the CW. The reporter noted this can leave a sensitive post up uncovered.
When the editor loads a post it sets
sensitivefrom the post's own flag:but on submit the CW is only sent when
sensitiveis true:spoiler_textandsensitiveare independent, so a post can carry a CW withsensitive: false. #1236 already fixed this for replies, and its description spells out when it happens: clients like Tusky "set thesensitiveflag back to false on replies with CWs when there isn't media attached". The reply path was changed then, the edit path still uses the old logic.This mirrors that fix, keeping
sensitivein the condition so a post with sensitive media but no CW is unaffected:Testing
Existing Playwright suite on Mobile Safari: 62 passed, 1 failed. The failure is
date-time-format.spec.js:176(en-SGlocale combination), which fails the same way onmainwithout this change.I couldn't add a test for this one. Reaching the edit composer needs an authenticated session, and #1236 was merged as a one-line change to the same function without a test, so I kept it consistent with that.