Closed Revyy closed 9 months ago
Thoughts? I could give it a go if you like.
Hmm, it must be that the collator cannot access the qeta database as the database dependency in the createBackendModule
is actually the search module database. So one should pass the PluginDatabaseManager
that is also passed to the Q&A plugin.
Other option would be to use the Q&A API like you mentioned. Not sure how much extra delay that would add to the collator but maybe it's a good way to go forward. If you'd like to do a PR for this, it would be great. By the way, the types for the API probably should be moved from the frontend to the common plugin so that they could be utilized in this case as well.
The current collator is not possible(afaik) to use with the new Backend system.
Adding the collator in a module for the search plugin similarly like below gives errors
relation questions does not exist
when the collator performs its queries.I think the issue is that when you extend the search plugin with a module to add a collator the collator get access to the database belonging to the search plugin, and therefore all queries will fail because the qeta tables do not exist in that database.
Instead, I think the collator needs to use an api provided by the backend to fetch questions.
I hacked together a solution just to verify that it kind of works. Something like the code below would be needed except the
/questions
endpoint does not play well with Service to Service authentication, so might need a new endpoint for this use case.