Skip to content

[PB-6473]: feat/mail blob pointer table#74

Draft
jzunigax2 wants to merge 6 commits into
masterfrom
feat/mail-blob-pointer-table
Draft

[PB-6473]: feat/mail blob pointer table#74
jzunigax2 wants to merge 6 commits into
masterfrom
feat/mail-blob-pointer-table

Conversation

@jzunigax2

Copy link
Copy Markdown
Contributor

Keep track of mail blobs using the new bucket entries table, on ingest event firing we store a pointer to the related network bucket entry so we can later on a delete event decrement size

@jzunigax2 jzunigax2 self-assigned this Jun 25, 2026
@jzunigax2 jzunigax2 added the enhancement New feature or request label Jun 25, 2026
@jzunigax2 jzunigax2 requested a review from xabg2 June 25, 2026 05:16
@jzunigax2 jzunigax2 force-pushed the feat/stalwart-events-webhook branch from 96cf7aa to 2a9c787 Compare June 30, 2026 14:54
Base automatically changed from feat/stalwart-events-webhook to master June 30, 2026 23:22
jzunigax2 added 6 commits July 1, 2026 17:34
- Added `findBucketContextByProviderInternalId` method to `AddressRepository` for resolving user and bucket context.
- Updated `AccountService` to delete provider links during account provisioning failure.
- Implemented `createBucketEntry` method in `BridgeClient` for creating bucket entries in response to Stalwart events.
- Enhanced `StalwartEventsService` to handle batch events and create bucket entries based on resolved account context.
- Added unit tests for the new functionality in `StalwartEventsService` and `AddressRepository` to ensure proper behavior.
- Updated `deleteEmail` method in `EmailService` to handle quota entry release upon email deletion.
- Introduced `releaseQuotaEntry` method to manage quota entries based on email deletion results.
- Modified `deleteEmail` in `MailProvider` to return a result object containing the deleted entry key.
- Enhanced unit tests for `EmailService` and `JmapMailProvider` to cover new deletion behavior and quota management scenarios.
- Integrated `BridgeClient` for handling quota entry deletions in the bridge service.
- Introduced `decodeStalwartIdBig` function to handle Stalwart IDs exceeding JavaScript's safe integer range, allowing for proper decoding of email IDs.
- Updated `decodeStalwartId` to utilize the new decoding function and throw an error for IDs exceeding safe integer limits.
- Enhanced `StalwartEventsAuthGuard` to throw an `UnauthorizedException` for malformed authorization headers lacking a colon separator.
- Added unit tests for the new decoding function and authentication guard to ensure robust error handling and functionality.
- Added migration for creating the `mail_bucket_entries` table to store email usage data.
- Introduced `MailUsageModule` and `MailUsageService` for managing email bucket entries and tracking usage.
- Updated `AddressRepository`, `EmailService`, and `StalwartEventsService` to integrate with the new mail usage functionality.
- Refactored `BridgeClient` methods to accommodate changes in bucket entry management.
- Enhanced models and repositories to support the new mail bucket entry structure.
- Modified `AddressRepository` to include `mailAccountId` in the returned results and updated account structure.
- Refactored `EmailService` to replace `BridgeClient` with `MailUsageService` for managing email quota entries.
- Enhanced unit tests across `AddressRepository`, `EmailService`, and `StalwartEventsService` to reflect changes in account ID handling and usage tracking.
- Introduced new tests for `MailUsageService` and `MailBucketEntryRepository` to ensure proper functionality and error handling.
…nd repositories

- Updated migration to change `mail_account_id` to `mail_address_id` in the `mail_bucket_entries` table.
- Refactored `AddressRepository`, `EmailService`, and `StalwartEventsService` to use `mailAddressId` instead of `mailAccountId`.
- Adjusted related models, repositories, and unit tests to reflect the new naming convention for better clarity and consistency.
- Enhanced tests in `MailUsageService` and `MailBucketEntryRepository` to ensure proper functionality with the updated identifiers.
@jzunigax2 jzunigax2 force-pushed the feat/mail-blob-pointer-table branch from efddac8 to 6692bb4 Compare July 1, 2026 23:40
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant