The GitHub Actions job "Pull Requests" on pekko.git/fix-source-combine-single has failed. Run started by GitHub user He-Pin (triggered by He-Pin).
Head commit for run: 45f7cbda003529623e9236a656c116f5e935d430 / He-Pin <[email protected]> fix(stream): Source.combine single source with type-transforming fan-in strategies (#2723) Motivation: Source.combine with a single source bypassed the fan-in strategy using an unsafe asInstanceOf cast. This worked for type-preserving strategies like Merge (T → T), but silently produced incorrect results for type-transforming strategies like MergeLatest (T → List[T]). For example: Source.combine(Seq(Source.single(1)))(MergeLatest(_)) emitted 1 instead of List(1) Modification: - Introduce TypePreservingFanIn marker trait for fan-in stages where T == U AND single-input behavior is a no-op pass-through (Merge, Concat, Interleave, MergePrioritized, OrElse) - MergeSequence intentionally NOT marked: despite being T → T, it validates sequence ordering (not a pure pass-through) - Source.combine single-source case: check TypePreservingFanIn trait before bypassing. Strategies without the trait are routed through the fan-in graph. - Relax Concat, Interleave, MergeSequence to accept inputPorts >= 1 (was > 1). This eliminates the need for a try-catch fallback in Source.combine and allows these stages to be used directly with a single input. - Use Source.fromGraph for non-Source Graph inputs safety - Add 14 regression tests (12 Scala + 1 Java + MergeSequence validation) Result: - MergeLatest/ZipWithN correctly apply their transformation even for single source - Merge/Concat/Interleave correctly bypass (type-preserving optimization) - MergeSequence correctly validates sequences even for single source - Unknown/third-party strategies default to routing through the fan-in graph (safe default for strategies that may transform types) - Binary compatibility maintained (verified via MiMa) References: - https://github.com/apache/pekko/issues/2723 - https://github.com/apache/pekko/pull/2726 Report URL: https://github.com/apache/pekko/actions/runs/23114887585 With regards, GitHub Actions via GitBox --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
