- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.6k
fix(taskprocessing): use the event for AppAPI to get list of AI providers #52050
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
Conversation
cc9d5e7    to
    29d07ed      
    Compare
  
    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.
Can we extend the tests for this?
29d07ed    to
    8468a4e      
    Compare
  
    | 
 I think it might be more effective to place the integration tests in the AppAPI or ExApps repositories, where they can actually validate the Provider registration end-to-end. Mocking the tests here might not fully cover both parts of the system, and events system in the Nextcloud Server is already covered with tests. | 
8468a4e    to
    a639015      
    Compare
  
    …ders Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
a639015    to
    c23ab0d      
    Compare
  
    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.
Thanks 💙
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.
🚀
| /backport to stable31 | 
Summary
Currently, external Task Processing providers (like those from AppAPI ExApps) might need to be loaded and registered on every request during AppAPI bootstrap, potentially impacting performance. This PR introduces an event-driven mechanism to allow the core Task Processing Manager to discover these providers on demand.
New Event: Introduced
OCP\TaskProcessing\Events\GetTaskProcessingProvidersEvent. This event is dispatched by the Manager when it needs to build the list of available providers and task types.A request-scoped static cache within
dispatchGetProvidersEventprevents redundant dispatching within the same request twice(fisrt time for Providers list and second time for custom TasksTypes list)TODO
Checklist