Skip to content

Conversation

@marcelklehr
Copy link
Member

No description provided.

This comment was marked as outdated.

@marcelklehr marcelklehr force-pushed the fix/more-improvements branch from fa55375 to 861b9ea Compare August 7, 2025 10:55
Copy link

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

This PR implements several improvements to the context chat application, focusing on enhanced queue processing prioritization, better error handling, and duplicate event cleanup. The changes prioritize new files over updates in the indexing queue and add comprehensive exception handling throughout various service layers.

  • Adds prioritization logic to process new files before updates in the queue system
  • Implements comprehensive exception handling across service layers with proper logging
  • Introduces a migration step to remove duplicate filesystem events

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/psalm-baseline.xml Updates psalm version and adds baseline for undefined class warning
src/components/ViewAdmin.vue Updates admin view text to show unseen files count alongside sent files
lib/Settings/AdminSettings.php Adds queued new files count to admin statistics
lib/Service/QueueService.php Implements prioritization logic and new file counting functionality
lib/Service/FsEventService.php Adds exception handling for file access operations
lib/Service/FsEventScheduler.php Improves error handling in owner retrieval logic
lib/Service/ActionScheduler.php Adds exception documentation and imports
lib/Public/ContentManager.php Wraps action service calls with exception handling
lib/Migration/RemoveDuplicateFsEvents.php Adds migration step to clean up duplicate filesystem events
lib/Listener/FileListener.php Improves error message clarity in filesystem event listener
lib/Db/QueueMapper.php Adds new file filtering and counting capabilities
lib/Db/QueueContentItemMapper.php Adds ordering to queue retrieval queries
lib/Db/QueueActionMapper.php Adds ordering to queue retrieval queries
lib/Db/FsEventMapper.php Implements duplicate prevention logic and adds ordering
lib/Command/Statistics.php Adds new file queue statistics to command output
lib/BackgroundJobs/FileSystemListenerJob.php Groups events by user and adds memory management

@marcelklehr marcelklehr force-pushed the fix/more-improvements branch from 5fb6f45 to aa387da Compare August 7, 2025 13:01
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

Looks good code wise. I'm not deep enough in the app so I can't judge the logic.

marcelklehr and others added 16 commits August 19, 2025 15:22
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>

# Conflicts:
#	lib/Public/ContentManager.php
#	lib/Service/FsEventService.php
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
by working per user and tearing down FS in between

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the fix/more-improvements branch from 086bb78 to d9e9382 Compare August 19, 2025 09:53
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the fix/more-improvements branch from d9e9382 to 26424a9 Compare August 19, 2025 09:56
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the fix/more-improvements branch from 58b01b1 to fb9cc9e Compare August 22, 2025 15:05
- add an index over the rows to speed up de-duplication, and uniqueness
  check upon insertion
- delete all instances of the row when the event is processed
- add more logging

Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the fix/more-improvements branch from fb9cc9e to cee6ea6 Compare August 22, 2025 15:07
@kyteinsky
Copy link
Contributor

Switched to progressive de-duplication as advised by Julien instead of doing it at once in a repair step since it was difficult to do come up with a query that limited the no. of entries deleted/inserted in one DB transation, which can cause issues in certain setups like Galera setups as Joas and Christoph noted.

marcelklehr and others added 3 commits August 25, 2025 10:17
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
Copy link
Member Author

See nextcloud/server#54620

@marcelklehr
Copy link
Member Author

Thanks for improving the migration step @kyteinsky !

Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

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

thanks for fixing the issue 🚀

@marcelklehr
Copy link
Member Author

@kyteinsky Now the backend embedder is failing

@kyteinsky
Copy link
Contributor

This PR also has the same issue so it's not a one-off at least: nextcloud/context_chat_backend#200
testing some changes there

@kyteinsky
Copy link
Contributor

Fixed the issue in context_chat_backend, see the PR linked above for details.

@kyteinsky kyteinsky merged commit d2d6ef6 into main Aug 27, 2025
76 of 85 checks passed
@kyteinsky kyteinsky deleted the fix/more-improvements branch August 27, 2025 12:50
@kyteinsky kyteinsky mentioned this pull request Aug 29, 2025
@kyteinsky kyteinsky mentioned this pull request Sep 23, 2025
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.

5 participants