-
Notifications
You must be signed in to change notification settings - Fork 484
Make Attachment Storage Optional for PostgreSQL Message Store #2837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: postgresql
Are you sure you want to change the base?
Conversation
| public static final String JOOQ_REACTIVE_TIMEOUT = "jooq.reactive.timeout"; | ||
| public static final Duration JOOQ_REACTIVE_TIMEOUT_DEFAULT_VALUE = Duration.ofSeconds(10); | ||
| public static final String ATTACHMENT_STORAGE_ENABLED = "attachment.storage.enabled"; | ||
| public static final boolean ATTACHMENT_STORAGE_ENABLED_DEFAULT_VALUE = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For JMAP users this makes sens to have this true
Maybe we can keep the existing behaviour given we provide an easy option to opt out?
|
Test classes have been updated, and the default value is set to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello and thanks for the contribution!
However, why are all the emls being rewritten here?
| .then(deleteAttachment(msgId, attachmentDAO)) | ||
| .then(postgresConfiguration.isAttachmentStorageEnabled() | ||
| ? deleteAttachment(msgId, attachmentDAO) | ||
| : Mono.empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional operator ain't really much used in James codebase. We usually prefer extracting this into a private method and using an explicit if condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I’ll fix it right away.
…Listener Extract attachment deletion conditional logic into private method with explicit if condition, following James code style conventions.


The parameter attachment.storage.enabled=false can be used to configure whether attachments are stored in the database.