Skip to content

fix(MULTIPLA-009-3): CU-86akhf8u5 Inline query keys used for mingo-dialog and mingo-dialog-messages caches - #398

Draft
flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/multipla-009-3-d3209b2a-c69bf2d8
Draft

flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/multipla-009-3-d3209b2a-c69bf2d8

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Closes findings from rule MULTIPLA-009-3 — Inline query keys used for mingo-dialog and mingo-dialog-messages caches.

Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.

# Fix confidence Finding Location
1 🔴 55 low — review closely Inline query keys used for mingo-dialog and mingo-dialog-messages caches src/app/(app)/mingo/hooks/use-mingo-realtime-subscription.ts:246

What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.


Run: https://product-hub.flamingo.so/admin/code-review
Run id: c69bf2d8-6eaa-4e2d-815b-af08b880c8df

Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.

ClickUp task: CU-86akhf8u5 OpenFrame OSS frontend review findings sweep (12 PRs)

@flamingo flamingo Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 What this fix changed, finding by finding

1 finding(s) fixed in this draft — 1 explained inline on the diff; 1 low-confidence hunk(s) need close review before merging.

if (chunk.streamSeq < lastAppliedStreamSeqRef.current) return;
lastAppliedStreamSeqRef.current = chunk.streamSeq;
}
queryClient.setQueryData<DialogNode | null | undefined>(['mingo-dialog', dialogId], prev =>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 Inline query keys used for mingo-dialog and mingo-dialog-messages caches

In src/app/(app)/mingo/hooks/use-mingo-realtime-subscription.ts, replaced the inline ['mingo-dialog', dialogId] and ['mingo-dialog-messages', dialogId] literals (in syncStreamStateFromChunk's setQueryData call and in the reconnect invalidateQueries effect inside DialogSubscription) with two local key-builder functions, mingoDialogQueryKey and mingoDialogMessagesQueryKey, defined at module scope. This centralizes the key shape within the file so both call sites cannot silently diverge from each other. However, the finding asks for constants from a "centralized query-keys module" shared with the query hook that fetches mingo-dialog data; since that module/hook was not visible in the provided material, I could not verify its exact export name or import path, so I did not invent an import to it — a complete fix would require locating that hook's query-key definition and importing the shared constant from there instead of (or re-exporting) the local builders added here.

🤖 Prompt for AI agents
In src/app/(app)/mingo/hooks/use-mingo-realtime-subscription.ts around line 246, review and complete this code-review fix: Inline query keys used for mingo-dialog and mingo-dialog-messages caches.
What the draft fix changed: In `src/app/(app)/mingo/hooks/use-mingo-realtime-subscription.ts`, replaced the inline `['mingo-dialog', dialogId]` and `['mingo-dialog-messages', dialogId]` literals (in `syncStreamStateFromChunk`'s `setQueryData` call and in the reconnect `invalidateQueries` effect inside `DialogSubscription`) with two local key-builder functions, `mingoDialogQueryKey` and `mingoDialogMessagesQueryKey`, defined at module scope. This centralizes the key shape within the file so both call sites cannot silently diverge from each other. However, the finding asks for constants from a "centralized query-keys module" shared with the query hook that fetches `mingo-dialog` data; since that module/hook was not visible in the provided material, I could not verify its exact export name or import path, so I did not invent an import to it — a complete fix would require locating that hook's query-key definition and importing the shared constant from there instead of (or re-exporting) the local builders added here.
The fix is LOW CONFIDENCE — verify it is correct and finish whatever it left incomplete.

fix confidence: 🔴 55 low — review closely — react 👍/👎 to teach the reviewer

@flamingo flamingo Bot changed the title fix(MULTIPLA-009-3): Inline query keys used for mingo-dialog and mingo-dialog-messages caches fix(MULTIPLA-009-3): CU-86akhf8u5 Inline query keys used for mingo-dialog and mingo-dialog-messages caches Sep 14, 2026
@michaelassraf

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant