The mailpanel currently writes message files directly to the file storage. It then only stores the filename in the request data as part of its return value to save().
This breaks containment as the LogTarget now has to reach into the data from save() to find a key it does not own for proper cleanup of mail files:
if (isset($manifest[$tag]['mailFiles'])) {
foreach ($manifest[$tag]['mailFiles'] as $mailFile) {
@unlink(Yii::getAlias($this->module->panels['mail']->mailPath) . "/$mailFile");
}
}
I propose we store the actual mail data in the structure saved by the LogTarget. This also makes it easier to replace the log target with another implementation like the one in #489 or #495.
Performance wise it shouldn't matter since both are still written to disk and reading from disk isn't that expensive. The (negligible) performance loss would occur when viewing a specific debug entry while not on the mail panel (it would load the full mail data but not use it).
The mailpanel currently writes message files directly to the file storage. It then only stores the filename in the request data as part of its return value to
save()
.This breaks containment as the
LogTarget
now has to reach into the data fromsave()
to find a key it does not own for proper cleanup of mail files:I propose we store the actual mail data in the structure saved by the
LogTarget
. This also makes it easier to replace the log target with another implementation like the one in #489 or #495.Performance wise it shouldn't matter since both are still written to disk and reading from disk isn't that expensive. The (negligible) performance loss would occur when viewing a specific debug entry while not on the mail panel (it would load the full mail data but not use it).