Conversation
baaba14 to
67afc41
Compare
67afc41 to
fc9ed33
Compare
mejo-
left a comment
There was a problem hiding this comment.
Thanks a lot @Koc, once again much appreciated!
Code changes look good to me. I see two problems though:
- Deleting a page now results in an error if the trash was not opened before, as deleting the page will move it in pages store from
allPages[collectiveIndex]array toallTrashPages[collectiveIndex]. I'd like to keep this logic if the trash pages already got loaded beforehands as this means thatallPagesandallTrashPagesstay in sync. Whennotify_pushis enabled, this even works for pages that got deleted by a remote user.
Maybe we should just change the logic to check if allTrashPages already got initialized for the collective in question and depending on that either only drop from allPages or also add to allTrashPages.
- Now
getTrashPages()is called each time the page trash is opened. I wonder whether we should check whetherallTrashPagesalready got initialized for the collective in question. Since we cache the store in browser local storage nowadays, we probably still need a way to ensure it gets updated after switching the collective.
So I'd suggest a variable to track whether allTrashPages got initialized for a particular collective that always holds the collectiveIndex for the active collective. If the trash page gets opened and the tracking variable is not set to the current collective yet, we fetch the page trash. If it's already set to the current collective, we don't.
What do you think?
c0d6846 to
fde8ecf
Compare
|
Hey @mejo-!
I don't see any errors, see attached video with opened console
Good catch, added nextcloud-trashed-pages-2026-03-09_00.58.30.mp4 |
You'll have to open a collective where the page trash was never fetched before to run into this bug. I'll push a fix for it. |
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Everytime a collective is opened, we want to fetch the page trash when opening it a first time to be in sync with the server state. Only closing and opening the page trash while staying within the collective should not fetch it again. Signed-off-by: Jonas <jonas@freesources.org>
If the page trash got not fetched for the collective yet, we cannot add to it. Signed-off-by: Jonas <jonas@freesources.org>
fde8ecf to
cd736d6
Compare
That's why the flag is reset each time the collective is switched. And as the flag is not persisted in browser storage, its scope is limited to the current browser tab. The idea was to make sure that each time a collective gets opened (either by browsing there or by switching the collective from within the app), opening the page trash for the first time will fetch the trashed pages. |

📝 Summary
In our organization we are actively using Collectives. And currently we have 2 performance issues with trashed pages:
WHERE INqueryThis PR aims to fix both of this issues
🖼️ Screenshots
🚧 TODO
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)