Closed Bug 1710951 Opened 5 years ago Closed 5 years ago

Phabricator Emails: Typed property PublicPing::$mainCommentMessage must not be accessed before initialization

Categories

(Conduit :: Phabricator, defect, P3)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mhentges, Assigned: mhentges)

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

Sentry ticket.
This is regressed from this patch. Note the one part of the commit message:

However, this doesn't mean that this can't cause
regressions: PHPDocs aren't enforced at runtime, while PHP typings are.
So, the additional strictness may cause unexpected surprises after
this lands.

Unexpected surprise confirmed.

To reproduce:

  1. Ping a user in an inline comment, submit.
  2. When PublicPing is instantiated, setMainComment() is never called, so intoPublicBody() throws an error when the "uninitialized" mainCommentMessage property is used

Now that PHP is tracking the typings, it's no longer accepting
the implicit null state of mainCommentMessage.

So, we explicitly set it to null in the constructor
so that PHP knows that we deliberately are ok with it being
used without being set.

Assignee: nobody → mhentges
Status: NEW → ASSIGNED
Keywords: conduit-triaged
Priority: -- → P3
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: