diff --git a/src/handlers/shared/start.ts b/src/handlers/shared/start.ts index 5acccb65..318300c5 100644 --- a/src/handlers/shared/start.ts +++ b/src/handlers/shared/start.ts @@ -35,16 +35,7 @@ export async function start(context: Context, issue: Context["payload"]["issue"] } catch (e) { logger.error("Error while getting commit hash", { error: e as Error }); } - - const assignedIssues = await getAssignedIssues(context, sender.login); - logger.info("Max issues allowed is", { limit: maxTask.limit, assigned: assignedIssues.length }); - - // check for max and enforce max - - if (assignedIssues.length >= maxTask.limit) { - throw new Error(`Too many assigned issues, you have reached your max limit of ${maxTask.limit} issues.`); - } - + // is it assignable? if (issue.state === ISSUE_TYPE.CLOSED) { diff --git a/tests/main.test.ts b/tests/main.test.ts index d8c4c54c..babf8d30 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -182,7 +182,7 @@ describe("User start/stop", () => { const context = createContext(issue, sender) as unknown as Context; context.adapters = createAdapters(getSupabase(), context as unknown as Context); - await expect(userStartStop(context)).rejects.toThrow(`Too many assigned issues, you have reached your max limit of ${memberLimit} issues.`); + await expect(userStartStop(context)).rejects.toThrow("You have reached your max task limit. Please close out some tasks before assigning new ones."); expect(memberLimit).toEqual(4); }); @@ -197,7 +197,7 @@ test("should set maxLimits to 6 if the user is an admin", async () => { const context = createContext(issue, sender) as unknown as Context; context.adapters = createAdapters(getSupabase(), context as unknown as Context); - await expect(userStartStop(context)).rejects.toThrow(`Too many assigned issues, you have reached your max limit of ${adminLimit} issues.`); + await expect(userStartStop(context)).rejects.toThrow("You have reached your max task limit. Please close out some tasks before assigning new ones."); expect(adminLimit).toEqual(6); });