-
Couldn't load subscription status.
- Fork 287
Open
Labels
3. to reviewbuggood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.Small tasks with clear documentation about how and in which place you need to fix things in.
Description
Expected behavior
Attachments added to new messages are stored in mail_attachments. At \OCA\Mail\Service\Attachment\AttachmentService::addFile we don't assign a value to createdAt, thus the timestamp is of default 0.
Actual behavior
The timestamp is set to a real value. We need this to clean up old data.
Mail app
Mail app version: v1.11
Implementation detail
- Inject
\OCP\AppFramework\Utility\ITimeFactoryinto\OCA\Mail\Service\Attachment\AttachmentService::__construct - Assign the time factory to a new private class property
- Use the time factor and
getTime()to fetch the current time stamp - Assign the time stamp value to the attachment via
LocalAttachment::setCreatedAt - Bonus: write a migration that drops the default value of the
mail_attachments.created_atcolumn and make it NOT NULL. That enforces that a value has to be specified for an insert and would have prevented this bug.
miaulalala
Metadata
Metadata
Assignees
Labels
3. to reviewbuggood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.Small tasks with clear documentation about how and in which place you need to fix things in.