gastownhall/beads · error

hydrate issue dependencies: %w

Error message

hydrate issue dependencies: %w

What it means

hydrateIssueOperation fetches dependency records for the issue and wraps failures with 'hydrate issue dependencies:'. It also guards a nil dependency use case with a distinct message, meaning the unit of work was built without dependency support. Failures here abort the whole hydrate so responses never omit dependency data.

Source

Thrown at internal/storage/uow/issue_operations.go:184

	} else {
		clone.Labels, err = labels.GetLabels(ctx, clone.ID)
	}
	if err != nil {
		return nil, fmt.Errorf("hydrate issue labels: %w", err)
	}

	dependencies := uw.DependencyUseCase()
	if dependencies == nil {
		return nil, fmt.Errorf("hydrate issue dependencies: dependency use case is unavailable")
	}
	var records map[string][]*types.Dependency
	if useWisp {
		records, err = dependencies.GetWispDependencyRecords(ctx, []string{clone.ID})
	} else {
		records, err = dependencies.GetIssueDependencyRecords(ctx, []string{clone.ID})
	}
	if err != nil {
		return nil, fmt.Errorf("hydrate issue dependencies: %w", err)
	}
	clone.Dependencies = records[clone.ID]

	if includeComments {
		comments := uw.CommentUseCase()
		if comments == nil {
			return nil, fmt.Errorf("hydrate issue comments: comment use case is unavailable")
		}
		if useWisp {
			clone.Comments, err = comments.GetCommentsForWisp(ctx, clone.ID)
		} else {
			clone.Comments, err = comments.GetCommentsForIssue(ctx, clone.ID)
		}
		if err != nil {
			return nil, fmt.Errorf("hydrate issue comments: %w", err)
		}
	}
	return storageissueops.CloneCreateRequest(publicops.CreateRequest{Issue: clone}).Issue, nil

View on GitHub (pinned to 71377f2769)

Solutions

  1. Check the wrapped error for the underlying dependency-query failure.
  2. If the message says the use case is unavailable, verify how the UnitOfWork provider is constructed and wire the dependency use case.
  3. Retry the operation to rule out transient storage errors.

Example fix

// before
uw := provider.New(ctx) // dependency use case nil
// after
uw := provider.NewWithAllUseCases(ctx) // includes DependencyUseCase
Defensive patterns

Strategy: validation

Validate before calling

// verify the UoW exposes a dependency use case before issuing updates
if uw.DependencyUseCase() == nil { return errors.New("dependency use case unavailable") }

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "dependency use case is unavailable") { return rewireProvider() }
    return retryOrSurface(err)
}

Prevention

When it happens

Trigger: GetWispDependencyRecords or GetIssueDependencyRecords returning an error during create/update/close hydration; or uw.DependencyUseCase() returning nil.

Common situations: Dependency tables missing or corrupted; wisp-plane routing choosing GetWispDependencyRecords when data lives on the issue plane; a UoW provider assembled without the dependency use case wired.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/c6db596b5ec6823b. Report an issue: GitHub.