Skip to content

Fix all messages / audit view not loading data when selected#2885

Open
ramonsmits wants to merge 1 commit intomasterfrom
fix/audit-autorefresh
Open

Fix all messages / audit view not loading data when selected#2885
ramonsmits wants to merge 1 commit intomasterfrom
fix/audit-autorefresh

Conversation

@ramonsmits
Copy link
Member

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

  • Components are broken down into sensible and maintainable sub-components.
  • Styles are scoped to the component using it. If multiple components need to share CSS, then a .css file is created containing the shared CSS and imported into component scoped style sections.
  • Naming is consistent with existing code, and adequately describes the component or function being introduced
  • Only functions utilizing Vue state or lifecycle hooks are named as composables (i.e. starting with 'use');
  • No module-level state is being introduced. If so, request the PR author to move the state to the corresponding Pinia store.

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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 useStoreAutoRefresh with an optional customRefresh(store) callback used only for polling.
  • Update audit polling to call checkForSuccessfulMessages() via customRefresh rather than overriding store.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.

@ramonsmits
Copy link
Member Author

ramonsmits commented Mar 13, 2026

This seems to fix something else but MIGHt sufficient for the issue that I'm experiencing:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants