Skip to content

feat: add non_blocking support for async fetch dependencies#547

Open
Clement-Hue wants to merge 1 commit intoharrisoncramer:developfrom
Clement-Hue:feature-draft-non-blocking
Open

feat: add non_blocking support for async fetch dependencies#547
Clement-Hue wants to merge 1 commit intoharrisoncramer:developfrom
Clement-Hue:feature-draft-non-blocking

Conversation

@Clement-Hue
Copy link
Copy Markdown

@Clement-Hue Clement-Hue commented Apr 23, 2026

Summary

This MR adds non_blocking support to the async fetch pipeline, allowing certain API dependencies to continue fetching subsequent dependencies even if they fail. The draft_notes dependency is marked as non-blocking.
Perhaps none should be blocking or even fetch in parallel?

Problem

When fetching draft_notes fails (e.g., due to permissions or unsupported GitLab editions), it blocks the entire async dependency chain, preventing all subsequent API calls from completing. This can break the plugin for users whose GitLab instance doesn't support draft notes, and as consequence preventing them to see and toggle the comments section.

Changes

  • lua/gitlab/async.lua: Added non_blocking logic — when a dependency is marked non_blocking, an on_error callback is created that continues fetching the next dependency instead of halting the chain. This callback is passed to job.run_job.
  • lua/gitlab/state.lua: Set non_blocking = true on the draft_notes dependency so its failure doesn't block the remaining fetches.

Allow dependencies marked as `non_blocking` to continue the fetch chain even on error, preventing a single failing request from blocking subsequent API calls. Applied to the `draft_notes` dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants