[Bug] Aside aggregate state reports stale when unselected profiles are absent

Open Beginner friendly
#8,355 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start with src/integrations/aside-profiles.ts and inspect how aggregateState receives profile states and enabled status. Reproduce the reported case with one enabled current profile and two disabled absent profiles; check existing tests for aggregation behavior. Done when disabled absent profiles do not make the aggregate stale, while an enabled outdated profile still does.

Written by the indexing model from the issue text.

Description

bug

Summary

The Aside card on the Integrations Overview shows 업데이트 필요 (stale) permanently whenever only some Aside profiles are enabled, even when every enabled profile is current.

Observed on ocx 2.99.0; same code on origin/dev (2.100.0).

Evidence

GET /api/client-integrations, aside aggregate:

state: "stale", enabledCount: 1, appliedCount: 1, total: 3
profile 0  current  enabled=true
profile 1  absent   enabled=false
profile 2  absent   enabled=false

Cause

src/integrations/aside-profiles.ts:

function aggregateState(states) {
  if (states.includes("unsafe")) return "unsafe";
  if (states.includes("conflict")) return "conflict";
  if (states.every(s => s === "absent")) return "absent";
  return states.every(s => s === "current") ? "current" : "stale";
}

A mix of current + intentionally-unselected absent falls through to stale. Profiles the user deliberately left off are counted as needing an update.

Suggested fix

Aggregate over enabled/selected profiles only (or treat absent on a not-enabled profile as neutral), so current + absent(disabled) reports current. Keep stale for an enabled profile whose block is outdated.

Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
23h
Merged PRs (30d)
687

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.