Fix all messages / audit view not loading data when selected#2885
Fix all messages / audit view not loading data when selected#2885ramonsmits wants to merge 1 commit intomasterfrom
Conversation
The auto-refresh composable was mutating the store's refresh method via Object.assign, replacing it with checkForSuccessfulMessages. This broke AuditList's full fetch since it also called store.refresh(). Add a customRefresh parameter to useStoreAutoRefresh so the lightweight checkForSuccessfulMessages can be used for polling without mutating the store.
There was a problem hiding this comment.
Pull request overview
Fixes the “All Messages / Audit view not loading until full page reload” behavior by preventing the auto-refresh composable from mutating the Pinia store’s refresh() method (which had unintended global side effects).
Changes:
- Extend
useStoreAutoRefreshwith an optionalcustomRefresh(store)callback used only for polling. - Update audit polling to call
checkForSuccessfulMessages()viacustomRefreshrather than overridingstore.refresh().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Frontend/src/composables/useAutoRefresh.ts |
Adds optional customRefresh hook so auto-refresh can poll lightweight checks without modifying store methods. |
src/Frontend/src/composables/useAuditStoreAutoRefresh.ts |
Switches audit polling to customRefresh to avoid breaking AuditStore.refresh() consumers (e.g., AuditList). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This seems to fix something else but MIGHt sufficient for the issue that I'm experiencing: |
|
@ramonsmits thanks for pinging us, ClaudeCode is right, Even though this PR fixes the bug, it would be better to consolidate all this functionality into the existing pinia store and use existing patterns. |
ALWAYS when I open all messages view nothing happens. Switching do a different tab and back still no data until I do a full page reload.
Note
This is a suggestion by Claude so this really needs to be reviewed by someone that understands this. I don't really have an understanding how the refresh is designed.
Background info
The auto-refresh composable was mutating the store's refresh method via Object.assign, replacing it with checkForSuccessfulMessages. This broke AuditList's full fetch since it also called store.refresh().
Add a customRefresh parameter to useStoreAutoRefresh so the lightweight checkForSuccessfulMessages can be used for polling without mutating the store.
Reviewer Checklist