- Implemented tests for ingesting TLS RPT reports from emails and ensuring they are stored correctly in the database. - Added tests to verify that the same report can be ingested multiple times without duplication. - Created tests for backfilling reports that were previously delivered to the inbox. - Developed WebSocket event handling tests to ensure events are correctly routed to subscribers based on mailbox ownership. - Included tests for the mail API to validate session handling, mailbox isolation, and error mapping. - Ensured that the API rejects unauthorized requests and handles malformed JSON gracefully.
9 lines
329 B
SQL
9 lines
329 B
SQL
-- Only removes the folder where it is still empty. A Reports folder holding
|
|
-- delivered reports is data, and dropping it would cascade those messages away.
|
|
DELETE FROM folders f
|
|
WHERE LOWER(f.name) = 'reports'
|
|
AND f.special_use IS NULL
|
|
AND NOT EXISTS (
|
|
SELECT 1 FROM email_messages e WHERE e.folder_id = f.id
|
|
);
|