Skip to content

fix(frontend): use global getter path for currentUser in moveChat (#828)

Jérôme Revillard requested to merge fix/828-move-chat-auth into main

Summary

Fixes #828 (closed) — regression introduced by #827 (closed) fix.

The auth Vuex module is NOT namespaced, so its getters live in the global namespace. chatHistoryStore.moveChat accessed rootGetters['auth/currentUser'] which returns undefined, throwing 'User is missing' and blocking moveConversation() entirely.

Before #827 (closed) this was a latent bug — ChatFolders called the move API directly first, so the move succeeded before the store action threw. The #827 (closed) fix removed that duplicate call, making the store action the sole path and turning the latent bug into an active regression.

Fix

Change 'auth/currentUser' to 'currentUser' to match the global namespace used by every other component (App.vue, ChatBotComponent, ChatFolders, NavBarComponent, SettingsComponent, AdminDashboard).

Test Gap

Tests passed rootGetters as a plain object { 'auth/currentUser': mockUser } — the mock resolved the key regardless of Vuex namespace rules. A real Vuex store would NOT resolve 'auth/currentUser' for an un-namespaced module. Test mocks updated to use the correct global key.

Closes #828 (closed)

Merge request reports

Loading