Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

fix: list archive

Nikolai Giman961ed7bf0640
diff --git a/api/src/tv-modules/lists/GoalListsRepository.ts b/api/src/tv-modules/lists/GoalListsRepository.ts
index bf3a306..7ff7c39 100644
--- a/api/src/tv-modules/lists/GoalListsRepository.ts
+++ b/api/src/tv-modules/lists/GoalListsRepository.ts
@@ -100,6 +100,7 @@ export class GoalListsRepository {
const updates: Partial<typeof GoalsListSchema.$inferInsert> = {};
if (data.name !== undefined && data.name !== null) updates.name = data.name;
if (data.description !== undefined) updates.description = data.description;
+ if (data.archive !== undefined) updates.archive = data.archive;
if (Object.keys(updates).length === 0) {
const current = await callWithCatch(() =>
diff --git a/api/src/tv-modules/lists/__tests__/GoalListsMassAssignment.spec.ts b/api/src/tv-modules/lists/__tests__/GoalListsMassAssignment.spec.ts
index 517f514..85358dc 100644
--- a/api/src/tv-modules/lists/__tests__/GoalListsMassAssignment.spec.ts
+++ b/api/src/tv-modules/lists/__tests__/GoalListsMassAssignment.spec.ts
@@ -23,7 +23,7 @@ describe('GoalListsRepository.updateListNew mass-assignment guard', () => {
vi.clearAllMocks();
});
- it('drops goalId, owner, creatorId and archive injected next to a legitimate field', async () => {
+ it('drops goalId, owner and creatorId injected next to a legitimate field', async () => {
const { set } = mockUpdateChain();
const repository = new GoalListsRepository();
@@ -33,7 +33,6 @@ describe('GoalListsRepository.updateListNew mass-assignment guard', () => {
goalId: 3,
owner: 9,
creatorId: 9,
- archive: 1,
someOther: 1
} as any);
@@ -41,6 +40,16 @@ describe('GoalListsRepository.updateListNew mass-assignment guard', () => {
expect(set.mock.calls[0][0]).toEqual({ name: 'renamed' });
});
+ it('writes archive, which is a user-editable field sent by the web app and MCP', async () => {
+ const { set } = mockUpdateChain();
+ const repository = new GoalListsRepository();
+
+ await repository.updateListNew({ id: 1, archive: 1 });
+
+ expect(set).toHaveBeenCalledTimes(1);
+ expect(set.mock.calls[0][0]).toEqual({ archive: 1 });
+ });
+
it('still writes name and description', async () => {
const { set } = mockUpdateChain();
const repository = new GoalListsRepository();
diff --git a/api/src/tv-modules/lists/list.types.ts b/api/src/tv-modules/lists/list.types.ts
index f5fe63c..1f42cbc 100644
--- a/api/src/tv-modules/lists/list.types.ts
+++ b/api/src/tv-modules/lists/list.types.ts
@@ -12,6 +12,7 @@ export const GoalListArkTypeUpdate = type({
id: 'number',
name: type('string | null').optional(),
description: type('string | null').optional(),
+ archive: type('0 | 1').optional(),
});
export type GoalListArgUpdate = typeof GoalListArkTypeUpdate.infer;
diff --git a/api/src/tv-modules/tasks/__tests__/TaskMassAssignment.integration.spec.ts b/api/src/tv-modules/tasks/__tests__/TaskMassAssignment.integration.spec.ts
index 5b443c1..281c3a5 100644
--- a/api/src/tv-modules/tasks/__tests__/TaskMassAssignment.integration.spec.ts
+++ b/api/src/tv-modules/tasks/__tests__/TaskMassAssignment.integration.spec.ts
@@ -164,9 +164,11 @@ describe('PATCH /module/tasks and /module/goal_lists mass assignment (integratio
expect(tasks.map((task) => task.id)).not.toContain(attackerTaskId);
});
- it("attack: injected goalId / owner / archive do not move the list into the victim's goal", async () => {
+ it("attack: injected goalId / owner do not move the list into the victim's goal, while the user's own edits apply", async () => {
const before = await listRow(attackerListId);
+ // archive is not injected: it is an ordinary edit of the caller's own
+ // list, the same thing the web app sends when a list is archived.
const response = await api.patch(
'/module/goal_lists',
{ id: attackerListId, name: 'pwned list', goalId: victimGoalId, owner: victimUserId, archive: 1 },
@@ -177,7 +179,7 @@ describe('PATCH /module/tasks and /module/goal_lists mass assignment (integratio
const after = await listRow(attackerListId);
expect(after.goal_id).toBe(attackerGoalId);
expect(after.owner).toBe(before.owner);
- expect(after.archive).toBe(before.archive);
+ expect(after.archive).toBe(1);
expect(after.name).toBe('pwned list');
});
});
diff --git a/docs/1.getting-started/2.installation.md b/docs/1.getting-started/2.installation.md
index ab9c287..cb2e506 100644
--- a/docs/1.getting-started/2.installation.md
+++ b/docs/1.getting-started/2.installation.md
@@ -108,8 +108,6 @@ services:
- ./.env.postgresql
volumes:
- pgdata:/var/lib/postgresql/data
- ports:
- - "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U taskview_db_user -d taskviewdb"]
interval: 5s
diff --git a/taskview-packages/taskview-api/src/api/__tests__/docker/docker-compose.yml b/taskview-packages/taskview-api/src/api/__tests__/docker/docker-compose.yml
index e48c7da..0297532 100644
--- a/taskview-packages/taskview-api/src/api/__tests__/docker/docker-compose.yml
+++ b/taskview-packages/taskview-api/src/api/__tests__/docker/docker-compose.yml
@@ -41,6 +41,9 @@ services:
# Domains that skip DNS/HTTP ownership proof — used by sso.test.ts to
# deterministically produce a *verified* config (method 'trusted').
SSO_TRUSTED_DOMAINS: "owned-sso.example"
+ # The webhook receiver of webhooks.test.ts runs on the host and is reached
+ # via host.docker.internal, a private address from inside the container.
+ WEBHOOKS_ALLOW_PRIVATE_URLS: "true"
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
diff --git a/taskview-packages/taskview-api/src/api/invoices.ts b/taskview-packages/taskview-api/src/api/invoices.ts
index 7748ee2..20f617c 100644
--- a/taskview-packages/taskview-api/src/api/invoices.ts
+++ b/taskview-packages/taskview-api/src/api/invoices.ts
@@ -29,9 +29,9 @@ export default class TvInvoicesApi extends TvApiBase {
return this.request(this.$axios.post<AppResponse<InvoiceItem>>(`${this.moduleUrl}/${id}/reissue`, {}))
}
- public async fetchPdf({ id, lang }: InvoiceArgPdf) {
- const response = await this.$axios.get<Blob>(`${this.moduleUrl}/${id}/pdf`, { params: { lang }, responseType: 'blob' })
- return response.data
+ public async fetchPdf({ id, lang }: InvoiceArgPdf): Promise<Blob> {
+ const response = await this.$axios.get<ArrayBuffer>(`${this.moduleUrl}/${id}/pdf`, { params: { lang }, responseType: 'arraybuffer' })
+ return new Blob([response.data], { type: 'application/pdf' })
}
public async delete(id: number) {