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

オープン 初心者向け
#8,355 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

src/integrations/aside-profiles.tsから始めて、aggregateStateがプロファイルの状態と有効状態をどのように受け取るかを調べてください。有効なcurrentプロファイル1つと無効なabsentプロファイル2つで、報告されたケースを再現してください。集約の動作に関する既存のテストを確認してください。無効なabsentプロファイルによって集約状態が古くならず、有効で古いプロファイルがある場合は引き続き古くなることを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
16.9k
フォーク
1.3k
平均マージ
23時間
マージ済み PR(30日)
687

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lidge-jun/opencodex のほかの issue

lidge-jun/opencodex の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。