Page MenuHomePhabricator

[native] Default parsedSpoilerIdentifier to null
ClosedPublic

Authored by rohan on Dec 7 2022, 9:31 AM.
Tags
None
Referenced Files
F3247158: D5839.id19252.diff
Fri, Nov 15, 3:46 AM
F3246827: D5839.diff
Fri, Nov 15, 2:00 AM
Unknown Object (File)
Sat, Nov 9, 11:50 AM
Unknown Object (File)
Sat, Nov 9, 11:50 AM
Unknown Object (File)
Sat, Nov 9, 11:49 AM
Unknown Object (File)
Fri, Nov 8, 9:59 AM
Unknown Object (File)
Thu, Nov 7, 5:47 AM
Unknown Object (File)
Thu, Nov 7, 5:47 AM
Subscribers

Details

Summary

Not a big deal, but @atul and I decided that we should default parsedSpoilerIdentifier to null in the event of an unexpected value. Note that I still need to explicity check if parsedSpoilerIdentifier !== null, since if I just checked if (parsedSpoilerIdentifier) and parsedSpoilerIdentifier = 0, it would make the condition false.

https://linear.app/comm/issue/ENG-2269/investigate-if-defaulting-parsedspoilerindex-to-1-is-the-best-solution

Test Plan

Tested both spoilers mid-text and at the start of the text to make sure they still work as expected.

Diff Detail

Repository
rCOMM Comm
Branch
ENG-2269
Lint
No Lint Coverage
Unit
No Test Coverage