matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Missing context cancellation in provider operations

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug daemonclient/service.go lines 246-299 use context.Background() for all provider operations, preventing timeout/cancellation from upper layers.

To reproduce Examine daemonclient/service.go:

func (p *providerWrapper) FetchEmails(ctx context.Context, folder string, limit, offset uint32) ([]backend.Email, error) {
    // ... 
    return p.FetchEmails(context.Background(), folder, limit, offset)  // Ignores ctx!
}

Lines 246, 254, 262, 270, 278, 287, 299 all use context.Background() instead of passed ctx parameter.

Expected behavior Use passed context parameter to respect cancellation/timeouts.

Additional context

  • Good first issue
  • Defeats purpose of passing context
  • Long operations can't be cancelled
  • daemon/handler.go sets timeouts but service.go ignores them

Suggested fix:

return p.FetchEmails(ctx, folder, limit, offset)  // Use ctx, not Background()

OS All platforms

andrinoff avatar Apr 21 '26 09:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 22 '26 06:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar Jun 04 '26 19:06 floatpanebot