Skip to content

feat: blocked tasks blocking#2891

Open
HarshPatel5940 wants to merge 10 commits into
go-vikunja:mainfrom
HarshPatel5940:feat/blocked-tasks-blocking
Open

feat: blocked tasks blocking#2891
HarshPatel5940 wants to merge 10 commits into
go-vikunja:mainfrom
HarshPatel5940:feat/blocked-tasks-blocking

Conversation

@HarshPatel5940

@HarshPatel5940 HarshPatel5940 commented Jun 10, 2026

Copy link
Copy Markdown

Resolves #2194

This pull request introduces logic to enforce task blocking: tasks that are blocked by other incomplete tasks cannot be marked as complete. It adds a new error type for this scenario, updates the task update process to check for blockers, and provides comprehensive tests to ensure the correct enforcement of blocking relationships.

Task blocking enforcement:

  • Added a check in Task.updateSingleTask to prevent marking a task as complete if any blocking tasks are not yet completed, returning a new ErrTaskIsBlocked error with details about the blockers.
  • Implemented the helper function getActiveBlockingRelations to retrieve all incomplete tasks that are blocking a given task.

Error handling improvements:

  • Introduced the ErrTaskIsBlocked error type, including HTTP error mapping, error code, and human-readable details about blocking tasks; also added a function to check for this error type.

Testing enhancements:

  • Added a comprehensive set of tests in TestTaskBlockingEnforcement to verify that blocked tasks cannot be completed until all blockers are done, and to check error details and edge cases.

@github-actions github-actions Bot added area/api REST API surface, endpoint design, request/response shapes area/task-relations Task relations: blocking, dependencies, parent/child links concern/ux UX polish, ergonomics, workflow complaints without a clear bug labels Jun 10, 2026
@HarshPatel5940

Copy link
Copy Markdown
Author

working on the concern ux

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Preview Deployment

Preview deployments for this PR are available at:

URL Tag Commit
https://pr-2891.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:pr-2891 latest
https://sha-a8bce2ef0b99ff98d4f65b4f1c384fd5950e4fd6.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-a8bce2ef0b99ff98d4f65b4f1c384fd5950e4fd6 a8bce2e
https://sha-f851e6f9590b56c8f3f95db742f51b71e2daf05a.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-f851e6f9590b56c8f3f95db742f51b71e2daf05a f851e6f
https://sha-a8a53c9581a0c86ba24d9833a0fb6b593eac2d89.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-a8a53c9581a0c86ba24d9833a0fb6b593eac2d89 a8a53c9
https://sha-a1621fec37e9b7a7a50f09146e6b53d9cd91beac.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-a1621fec37e9b7a7a50f09146e6b53d9cd91beac a1621fe
https://sha-328de89c0b69fd7ee9ba32b0b4fed9d677a94004.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-328de89c0b69fd7ee9ba32b0b4fed9d677a94004 328de89
https://sha-e16d12023684e05d546f8f3508678c1b136e7d97.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-e16d12023684e05d546f8f3508678c1b136e7d97 e16d120
https://sha-8502c541a638693830e5da2025bd4aa5ebaf642d.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-8502c541a638693830e5da2025bd4aa5ebaf642d 8502c54

The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the pr-2891 image — the preview picks up the new version on restart. The per-commit URLs point to a specific version and will not change.

Run locally with Docker
docker pull ghcr.io/go-vikunja/vikunja:pr-2891
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-2891

Last updated for commit a8bce2e

@HarshPatel5940

Copy link
Copy Markdown
Author

@kolaente :) ping pong

@HarshPatel5940

Copy link
Copy Markdown
Author

@kolaente is this something you require me to resolve conflicts and work?

or you never want this feature and are gonna close? this way i save any more efforts in this PR if so

@kolaente

kolaente commented Jul 11, 2026

Copy link
Copy Markdown
Member

Hey sorry for the silence! I have a bunch of things on my plate right now with my day job and other Vikunja things.

I would like to have this feature and think it makes sense to have it, just need to set aside some time to review it properly.

Don't worry about the conflicts, we'll resolve these shortly before merging.

@HarshPatel5940

Copy link
Copy Markdown
Author

Hey sorry for the silence! I have a bunch of things on my plate right now with my day job and other Vikunja things.

I would like to have this feature and think it makes sense to have it, just need to set aside some time to review it properly.

Don't worry about the conflicts, we'll resolve these shortly before merging.

Make sense! Thank you for the reply and it's understandable!

Will resolve the conflicts 🫂

@kolaente

Copy link
Copy Markdown
Member

Please check the failing frontend lint though

"14001": "The provided api token is invalid.",
"14002": "The permission {permission} of group {group} is invalid."
"14002": "The permission {permission} of group {group} is invalid.",
"20001": "This task is blocked by incomplete tasks and cannot be marked as done."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two times the same message?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same msg?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the pretty much the same as in line 944

Comment thread frontend/src/components/tasks/partials/SingleTaskInProject.vue Outdated
Comment thread frontend/src/views/tasks/TaskDetailView.vue
Comment thread pkg/models/tasks.go Outdated
@HarshPatel5940

Copy link
Copy Markdown
Author

will clear the comments, lints and merge and update shortly.

@HarshPatel5940
HarshPatel5940 force-pushed the feat/blocked-tasks-blocking branch from 5c69958 to 696cc2c Compare July 13, 2026 05:11
@HarshPatel5940
HarshPatel5940 requested a review from kolaente July 13, 2026 06:10
@HarshPatel5940

Copy link
Copy Markdown
Author

the comments have been addressed.

Comment thread pkg/models/tasks.go Outdated
@HarshPatel5940

Copy link
Copy Markdown
Author

@kolaente i did some cleanup, I know you asked me to return the list and frontend just builts msg for it.

Until i realise frontend already has the knowledge of the tasks and can check locally for just relationships. So i did that.

This saves an api call i presume and thats good right? 🤔 tho i am still worried of some edge case scenarios maybe you help me on confirm this.

@kolaente

Copy link
Copy Markdown
Member

it might be possible in the kanban or gantt view that the subtasks are not loaded for certain filters. But as you said, that's an edge case. You could do a fallback thing: If the tasks are not present locally, do a fetch.
IMHO just returning the full tasks in the error and then building the proper errror string in the frontend should handle all edge cases. Since we're already fetching the full tasks during the relation blocking check, we don't save a roundtrip by not returning them, and the implementation would be more robust.

@HarshPatel5940

Copy link
Copy Markdown
Author

Ahhhh make sense. Will do it and reply back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api REST API surface, endpoint design, request/response shapes area/task-relations Task relations: blocking, dependencies, parent/child links concern/ux UX polish, ergonomics, workflow complaints without a clear bug waiting for reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blocked tasks can be marked completed

2 participants