gastownhall/beads · error

GetNewlyUnblockedByClose %s: %w

Error message

GetNewlyUnblockedByClose %s: %w

What it means

Returned by getNewlyUnblockedByClose when the repository call issueRepo.GetNewlyUnblockedByClose fails while fetching issues unblocked by closing closedID. The closed issue ID and the wrapped underlying error are included, preserving the root cause via %w. This is a storage-layer failure passed through the use-case layer.

Source

Thrown at internal/storage/domain/issue.go:1782

	}
	return open, nil
}

func (u *issueUseCaseImpl) GetNewlyUnblockedByClose(ctx context.Context, closedID string) ([]*types.Issue, error) {
	return u.getNewlyUnblockedByClose(ctx, closedID)
}

func (u *issueUseCaseImpl) GetNewlyUnblockedByCloseWisp(ctx context.Context, closedID string) ([]*types.Issue, error) {
	return u.getNewlyUnblockedByClose(ctx, closedID)
}

func (u *issueUseCaseImpl) getNewlyUnblockedByClose(ctx context.Context, closedID string) ([]*types.Issue, error) {
	if closedID == "" {
		return nil, fmt.Errorf("GetNewlyUnblockedByClose: closedID must not be empty")
	}
	out, err := u.issueRepo.GetNewlyUnblockedByClose(ctx, closedID)
	if err != nil {
		return nil, fmt.Errorf("GetNewlyUnblockedByClose %s: %w", closedID, err)
	}
	return out, nil
}

func (u *issueUseCaseImpl) ClaimReadyIssue(ctx context.Context, filter types.WorkFilter, actor string) (ClaimReadyResult, error) {
	return u.claimReady(ctx, filter, actor, false)
}

func (u *issueUseCaseImpl) ClaimReadyWisp(ctx context.Context, filter types.WorkFilter, actor string) (ClaimReadyResult, error) {
	return u.claimReady(ctx, filter, actor, true)
}

func (u *issueUseCaseImpl) claimReady(ctx context.Context, filter types.WorkFilter, actor string, useWisp bool) (ClaimReadyResult, error) {
	var (
		issue *types.Issue
		err   error
	)
	if useWisp {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped error after 'GetNewlyUnblockedByClose <id>:' for the root cause
  2. Verify closedID exists before closing/unblocking logic runs
  3. Retry on transient storage errors; check DB connectivity if persistent
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := uc.GetIssue(ctx, closedID); err != nil {
    return fmt.Errorf("closed issue %s not found: %w", closedID, err)
}

Type guard

func hasID(id string) bool { return strings.TrimSpace(id) != "" }

Try / catch

unblocked, err := uc.GetNewlyUnblockedByClose(ctx, closedID)
if err != nil {
    log.Warnf("unblocked lookup failed for %s: %v", closedID, err)
    return nil
}

Prevention

When it happens

Trigger: Calling GetNewlyUnblockedByClose / GetNewlyUnblockedByCloseWisp with a non-empty closedID whose dependent lookup fails: closedID references a nonexistent issue, the database connection fails, or the blockers/dependencies query errors.

Common situations: Post-close webhooks querying dependents of an issue that was deleted concurrently; Dolt connection reset during the query; stale ID cached from a previous session pointing at a purged issue.

Related errors


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