Skip to content

Fix circular DI dependency during Request bootstrap with UploadedFile #492

Description

@armanist

Problem

A web request can fail with:

Circular dependency detected: Quantum\Http\Request -> Quantum\Http\Request

Root path:

  • Request bootstrap parses uploaded files
  • UploadedFile::__construct() eagerly resolves fs() and uploads config
  • That path reaches Setup and request() while Request is still resolving
  • DI correctly detects recursion and throws

Scope

Apply a minimal fix in UploadedFile:

  • keep constructor side-effect free
  • lazily resolve filesystem/config only when needed for file operations

Acceptance Criteria

  • No circular dependency on request bootstrap when files are present
  • Existing upload behavior remains unchanged
  • Relevant unit tests pass (UploadedFile, Request, request file trait, web adapter flow)

Notes

This ticket is intentionally narrow and does not include broader upload architecture refactoring.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions