Extract collection performance refactors from mobile stack#2854
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Mechanical performance refactor converting You can customize Macroscope's approvability policy. Learn more. |
Summary
Validation
bun fmtbun lint(passes with existing warnings)bun typecheckcd apps/server && bun run test(1023passed,4skipped)Note
Low Risk
Mechanical refactors with equivalent filtering/mapping logic; no auth, persistence contracts, or user-facing behavior changes indicated in the diff.
Overview
Replaces chained filter/map (and similar multi-pass array pipelines) with single-pass collection handling across server, web,
packages/shared, SSH, and Tailscale.Most call sites now use explicit
forloops or EffectArray.filterMap/Arr.filterMapwithResult.succeed/Result.failVoid. A few spots also swap ad-hoc dedup (e.g.indexOf) forSet-based uniqueness, andlatestUserMessageAtin the projection pipeline is computed with a linear scan instead of filter-sort-at(-1).Behavior and APIs are unchanged; this is a performance/clarity refactor split out of the mobile stack.
Reviewed by Cursor Bugbot for commit 1d7cce3. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Replace map/filter pipelines with explicit loops across server and web collection utilities
Refactors collection processing in a large number of utilities across the server, web, and shared packages, replacing chained
filter/mappipelines with explicitfor-ofloops orArr.filterMap(fromeffect/Array) withResult.succeed/Result.failVoid. The change is purely mechanical — logic, data sources, and return types are unchanged throughout.Macroscope summarized 1d7cce3.