mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-27 19:35:13 +01:00
fix(repositories): lazily initialize heartbeat access services
Keep the repository and authorization services scoped to the heartbeat context path so unrelated issue-route fixtures do not need repository-specific service mocks. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
b4ae094afa
commit
4dafea4e79
1 file changed
+2
-4
@@ -2737,8 +2737,6 @@ export function issueRoutes(
|
||||
const instanceSettings = instanceSettingsService(db);
|
||||
const agentsSvc = agentService(db);
|
||||
const projectsSvc = projectService(db);
|
||||
const repositoryAccessSvc = repositoryAccessService(db);
|
||||
const authorizationSvc = authorizationService(db);
|
||||
const goalsSvc = goalService(db);
|
||||
const issueApprovalsSvc = issueApprovalService(db);
|
||||
const recoveryActionsSvc = issueRecoveryActionService(db);
|
||||
@@ -5829,11 +5827,11 @@ export function issueRoutes(
|
||||
includeForIssueComment: wakeCommentId !== null,
|
||||
});
|
||||
const effectiveRepositories = issue.assigneeAgentId
|
||||
? ((await repositoryAccessSvc.listEffectiveRepositories({
|
||||
? ((await repositoryAccessService(db).listEffectiveRepositories({
|
||||
companyId: issue.companyId,
|
||||
agentId: issue.assigneeAgentId,
|
||||
canAccessProject: async (candidate) => {
|
||||
const decision = await authorizationSvc.decide({
|
||||
const decision = await authorizationService(db).decide({
|
||||
actor: {
|
||||
type: "agent",
|
||||
agentId: issue.assigneeAgentId,
|
||||
|
||||
Reference in new issue
Block a user