fix: prefer live workbench reads over stale capability checks
This commit is contained in:
@@ -2514,17 +2514,14 @@ async function bootstrap() {
|
||||
const accountListPath = getWorkbenchRoute(platform, "accounts");
|
||||
const trackingAccountsPath = getWorkbenchRoute(platform, "trackingAccounts");
|
||||
const trackingDigestPath = getWorkbenchRoute(platform, "trackingDigest");
|
||||
const supportsAccounts = accountListPath && backendSupports(accountListPath);
|
||||
const supportsTrackingAccounts = trackingAccountsPath && backendSupports(trackingAccountsPath);
|
||||
const supportsTrackingDigest = trackingDigestPath && backendSupports(trackingDigestPath);
|
||||
const accounts = supportsAccounts
|
||||
const accounts = accountListPath
|
||||
? await storyforgeFetch(accountListPath).catch(() => [])
|
||||
: [];
|
||||
const trackingAccountsPayload = supportsTrackingAccounts
|
||||
const trackingAccountsPayload = trackingAccountsPath
|
||||
? await storyforgeFetch(trackingAccountsPath).catch(() => ({ items: [], cursor_last_seen_at: "" }))
|
||||
: { items: [], cursor_last_seen_at: "" };
|
||||
const trackingCursorLastSeenAt = trackingAccountsPayload?.cursor_last_seen_at || "";
|
||||
const trackingDigest = supportsTrackingDigest
|
||||
const trackingDigest = trackingDigestPath
|
||||
? await storyforgeFetch(`${trackingDigestPath}?since=${encodeURIComponent(trackingCursorLastSeenAt || getTrackingSinceIso(platform))}&limit=24`).catch(() => ({
|
||||
items: [],
|
||||
tracked_accounts: [],
|
||||
@@ -5974,12 +5971,12 @@ function renderTrackingScreen() {
|
||||
}
|
||||
const currentPlatform = getCurrentPlatformValue();
|
||||
const trackingAccountsPath = getWorkbenchRoute(currentPlatform, "trackingAccounts");
|
||||
if (!trackingAccountsPath || !backendSupports(trackingAccountsPath)) {
|
||||
if (!trackingAccountsPath) {
|
||||
return screenShell(
|
||||
"跟踪账号",
|
||||
`${getPendingWorkbenchReason(currentPlatform)}。`,
|
||||
`${button("跳到找对标", "goto-discovery", "primary")}`,
|
||||
renderEmptyState("跟踪能力暂未接入", `这套后端还没有接入 ${platformLabel(currentPlatform)} 跟踪接口,等 live collector 同步后这里会自动切成真实日报。`)
|
||||
renderEmptyState("跟踪能力暂未接入", `当前实例还没有提供 ${platformLabel(currentPlatform)} 跟踪入口,等 collector 开放后这里会自动切成真实日报。`)
|
||||
);
|
||||
}
|
||||
const trackedAccounts = getTrackingAccounts().filter((item) => item.platform === currentPlatform);
|
||||
|
||||
@@ -304,6 +304,7 @@ test("tracking refresh and top-video analysis flows expose async feedback inside
|
||||
assert.match(APP, /function isMissingBackendCapability\(/);
|
||||
assert.match(tracking, /批量同步已排队|单账号同步已排队|后台同步状态/);
|
||||
assert.match(tracking, /去生产中心/);
|
||||
assert.doesNotMatch(tracking, /这套后端还没有接入.*跟踪接口/);
|
||||
|
||||
assert.match(APP, /function getSelectedTopVideoAnalysisResult\(/);
|
||||
assert.match(discovery, /最近高分拆解/);
|
||||
|
||||
Reference in New Issue
Block a user