From 7f9e35d1e8bf2542f4aa27f9724973cf687808c5 Mon Sep 17 00:00:00 2001 From: jearhe <0verme7753@gmail.com> Date: Tue, 1 Sep 2026 13:55:02 +0800 Subject: [PATCH] fix(rocketmq): search consumer groups beyond first page --- .../src/components/mq/SubscriptionsPanel.vue | 24 +-- .../mq/__tests__/SubscriptionsPanel.spec.ts | 31 ++- crates/dbx-core/src/mq/adapters/rocketmq.rs | 196 ++++++++++++++++-- 3 files changed, 223 insertions(+), 28 deletions(-) diff --git a/apps/desktop/src/components/mq/SubscriptionsPanel.vue b/apps/desktop/src/components/mq/SubscriptionsPanel.vue index b8db362771..55a82bae93 100644 --- a/apps/desktop/src/components/mq/SubscriptionsPanel.vue +++ b/apps/desktop/src/components/mq/SubscriptionsPanel.vue @@ -37,7 +37,6 @@ const { confirmMqWrite } = useMqMutationGuard(() => props.connectionId); const subscriptions = ref([]); const loading = ref(false); const enriching = ref(false); -const truncatedHint = ref(); const enrichFailedHint = ref(); const error = ref(); let loadSeq = 0; @@ -170,7 +169,6 @@ async function loadSubscriptions() { const topicRef = getListTopicRef(); if (!topicRef) { subscriptions.value = []; - truncatedHint.value = undefined; enrichFailedHint.value = undefined; return; } @@ -178,7 +176,6 @@ async function loadSubscriptions() { loading.value = true; enriching.value = false; error.value = undefined; - truncatedHint.value = undefined; enrichFailedHint.value = undefined; try { // Fast list first (no enrich / online members) so large clusters paint quickly. @@ -186,20 +183,16 @@ async function loadSubscriptions() { if (seq !== loadSeq) return; subscriptions.value = page; syncSelectedSubscription(page); - if (isClusterWideMode.value && page.length >= 500) { - truncatedHint.value = t("mqSubscriptions.truncatedHint", { count: page.length }); - } if (isClusterWideMode.value) { enriching.value = true; try { const enriched = await mqEnrichSubscriptions(props.connectionId, topicRef); if (seq !== loadSeq) return; - subscriptions.value = enriched; + // Keep the complete fast list even if an older/slow agent returns only a partial enrichment page. + const merged = mergeSubscriptionEnrichment(page, enriched); + subscriptions.value = merged; // Detail dialog holds a snapshot; refresh so topics/members arrive after enrich. - syncSelectedSubscription(enriched); - if (enriched.length >= 500) { - truncatedHint.value = t("mqSubscriptions.truncatedHint", { count: enriched.length }); - } + syncSelectedSubscription(merged); } catch (e: unknown) { // Keep the fast list if enrichment times out; surface why online columns stayed empty. if (seq === loadSeq) { @@ -216,6 +209,14 @@ async function loadSubscriptions() { } } +function mergeSubscriptionEnrichment(fastList: SubscriptionInfo[], enrichedList: SubscriptionInfo[]): SubscriptionInfo[] { + const enrichedByName = new Map(enrichedList.map((subscription) => [subscription.name, subscription])); + return fastList.map((subscription) => { + const enriched = enrichedByName.get(subscription.name); + return enriched ? { ...subscription, ...enriched } : subscription; + }); +} + function openCreateDialog() { if (props.readOnly) { error.value = t("mqSubscriptions.readOnly"); @@ -526,7 +527,6 @@ watch(