Skip to content

Error while changing notification subject via listener #1964

@MichaelAben

Description

@MichaelAben

The error "Failed stopping measure '$name' because it hasn't been started" from DebugBar\DataCollector\TimeDataCollector:100 is triggered because the subject of a notification that is being sent is changed by a listener on the Illuminate\Mail\Events\MessageSending, which is called later than the Fruitcake\LaravelDebugbar\CollectorProviders\MailCollectorProvider is starting the measure at line 29.

So if your application wants to add the LOCAL tag on an email notification when a project is running locally (my usecase). It needs to be done in an event listener, but if that listener is triggered later than when startMeasure is called, the measure name is going to be changed and thus trow this error when stopping the measure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions