fix: load app config on archive and update conversation routes

The /archive and /update routes call saveConvo with req.config.interfaceConfig
but did not run configMiddleware, so req.config was undefined. After enabling
ephemeral retention, archiving or renaming a pre-existing permanent
conversation left it non-temporary with no expiredAt, bypassing the policy.

Apply configMiddleware to both routes so saves enforce retention consistently.
This commit is contained in:
Marco Beretta 2026-06-18 08:38:27 +02:00
parent adb17c83f8
commit 9a5e63695e
No known key found for this signature in database
GPG key ID: D918033D8E74CC11

View file

@ -174,7 +174,7 @@ router.delete('/all', async (req, res) => {
* @param {boolean} req.body.arg.isArchived - Whether to archive (true) or unarchive (false).
* @returns {object} 200 - The updated conversation object.
*/
router.post('/archive', validateConvoAccess, async (req, res) => {
router.post('/archive', validateConvoAccess, configMiddleware, async (req, res) => {
const { conversationId, isArchived } = req.body?.arg ?? {};
if (!conversationId) {
@ -240,7 +240,7 @@ const MAX_CONVO_TITLE_LENGTH = 1024;
* @param {string} req.body.arg.title - The new title for the conversation.
* @returns {object} 201 - The updated conversation object.
*/
router.post('/update', validateConvoAccess, async (req, res) => {
router.post('/update', validateConvoAccess, configMiddleware, async (req, res) => {
const { conversationId, title } = req.body?.arg ?? {};
if (!conversationId) {