[BUG] Factory board only polls the project's first linked repository, so other linked repositories' existing issues and PRs never become cards
Versions
@mastra/factory0.17.2 (self-hosted, direct GitHub App integration)
Expected
Every repository linked to a project (and selected under Work Intake → GitHub issues: "Open issues from the selected repositories feed every member's board") gets its open issues and pull requests on the board.
Actual
Only the project's first linked repository does. Repositories linked after it stay empty until their issue lists are requested directly.
Cause
- Existing issues and PRs become cards only as a side effect of
GET /web/github/projects/:projectRepositoryId/issues|prs(integrations/github/routes.js), which ingests every item it returns (ingestPolledEvents). - The board calls those routes only for
factory.repositories[0](the Work/Review board page passesrepository: factory.repositories[0]to the board, which polls its issues/PRs every 30 s). There is no way to choose another repository. - Linking a repository (
POST /web/factory/projects/:id/source-control-connections/:connectionId/repositories) imports nothing.ProjectRouteshas anonProjectRepositoryLinkedhook, butMastraFactorydoesn't pass one and hosts can't configure it. - So repositories after the first only get cards for new webhook activity, and they have no polling fallback for missed webhooks.
Repro
- Link two repositories with open issues to one project; select both under Work Intake.
- Open the Work board: cards appear for the first repository only.
GET /web/github/projects/<second project repository id>/issues→ the second repository's cards appear.
Suggested fix
Poll (or ingest once on link, then rely on webhooks plus the reconcile sweep) every linked repository instead of repositories[0], for example by running the ingest in onProjectRepositoryLinked and in the existing sweep.
Workaround
A host can wrap the repository-link route in server.apiRoutes and, after a 201, load the new repository's /web/github/projects/:id/issues and /prs pages as the linking user. We run this in production.
Source: mastra-ai/mastra