You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PipelineBuilder: consider FIFO instead of LIFO for intuitive middleware ordering #437
PipelineBuilder uses ImmutableStack (LIFO) for middleware registration:
// Registration order (developer writes):builder.UseMiddlewareIf<PatchMiddleware>(true).UseMiddleware<CompressMiddleware>().UseMiddleware<HashMiddleware>();// Actual LIFO execution order: Hash -> Compress -> Patch
A developer naturally expects registration order to match execution order. The LIFO semantics caused a bug in MacStrategy (fixed in #436) where the registration order was wrong because the author expected FIFO behavior.
Proposal
Change ImmutableStack to ImmutableQueue (FIFO) or List<IMiddleware> with forward iteration. This would require reversing the registration order in WindowsStrategy and LinuxStrategy (which currently depend on LIFO to get Hash executed first).
Scope
Pipeline/PipelineBuilder.cs
Strategy/WindowsStrategy.cs
Strategy/LinuxStrategy.cs
Related PipelineBuilder tests
Priority
Low — the current code works correctly after #436, but this change would prevent future maintainers from making the same mistake.
Activity