Skip to content

Extract collection performance refactors from mobile stack#2854

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/collection-performance-refactors
May 28, 2026
Merged

Extract collection performance refactors from mobile stack#2854
juliusmarminge merged 1 commit into
mainfrom
codex/collection-performance-refactors

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 28, 2026

Summary

  • move general collection/deduplication parsing rewrites out of the mobile remote-connect PR
  • keep the changes scoped to existing server, web, shared, SSH, and Tailscale modules
  • leave mobile/client-runtime-dependent terminal and remote review changes in the mobile stack

Validation

  • bun fmt
  • bun lint (passes with existing warnings)
  • bun typecheck
  • cd apps/server && bun run test (1023 passed, 4 skipped)

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 for loops or Effect Array.filterMap / Arr.filterMap with Result.succeed / Result.failVoid. A few spots also swap ad-hoc dedup (e.g. indexOf) for Set-based uniqueness, and latestUserMessageAt in 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/map pipelines with explicit for-of loops or Arr.filterMap (from effect/Array) with Result.succeed/Result.failVoid. The change is purely mechanical — logic, data sources, and return types are unchanged throughout.

Macroscope summarized 1d7cce3.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7ecdfe01-6efe-468c-9d28-cfe51574a5fe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/collection-performance-refactors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels May 28, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 28, 2026

Approvability

Verdict: Approved

Mechanical performance refactor converting .filter().map() chains to imperative for-loops across ~40 files. All changes follow an identical pattern with no behavioral modifications - purely an iteration style change to reduce intermediate array allocations.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit 3126894 into main May 28, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the codex/collection-performance-refactors branch May 28, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant