-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(settings): reset limit to groups state when switching apps #57078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(settings): reset limit to groups state when switching apps #57078
Conversation
67e7ce9 to
74ba653
Compare
|
/backport to stable32 |
|
/backport to stable31 |
Signed-off-by: Peter Ringelmann <[email protected]>
Head branch was pushed to by a user without write access
74ba653 to
bfd7138
Compare
artonge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't a watcher on app work in this case? This would allow the AppDetailsTab component to properly react when the app changes.
Yes, you're right that a watcher would work here, but I’d prefer to stick with the key approach. The component relies on the |
Well its a performance drawback, on the long run we should properly clean the internal state so that we can reuse the mounted component. But agree with that mixin its harder to keep track of state, an additional reason to finally remove all of them. |
Agreed on all counts. The performance hit should be negligible for this component, but refactoring out the mixins to enable proper state reuse is definitely the better long-term goal |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Summary
Fixes an issue where "Limit to groups" settings leak between apps when navigating the sidebar.
Before:
Nextcloud_server_20685_before.mp4
After:
Nextcloud_server_20685_after.mp4
Vue was recycling the
AppDetailsTabcomponent, preserving its local state. I added:key="app.id"toAppStoreSidebarto force component re-creation when switching apps.Why this approach?
I opted to force a re-mount instead of manually resetting state. While this introduces a negligible performance cost compared to instance reuse, it guarantees a 100% clean state for every app and allows us to remove fragile watcher logic. This makes the code more robust and easier to maintain.
A note on testing
Unit tests were skipped because the settings app doesn't have a test harness set up yet.
I also looked into adding this to the existing Cypress E2E tests, but it felt like overkill to spin up a full browser session just to check a checkbox state reset.
I manually verified the fix by switching between apps and confirming the "Limit to groups" setting resets correctly every time.
Checklist
3. to review, feature component)stable32)