diff --git a/backend/db/models/user.js b/backend/db/models/user.js index b56cb3b83..524ef02c2 100644 --- a/backend/db/models/user.js +++ b/backend/db/models/user.js @@ -475,6 +475,14 @@ module.exports = (sequelize, DataTypes) => { } } } + + // Role rows live on user_role_matching; User.findAll (via getAll) is cached. + // Clear after commit so the next dashboard load cannot serve a pre-commit cache entry. + options.transaction.afterCommit(() => { + if (User.cache) { + User.cache.clear(); + } + }); } /**