ref(issues): Remove grouping store#115970
Conversation
The merged fingerprints tab was using a Reflux store even though every real caller lived in the same issue details area. This moves the endpoint query and local UI state into groupMerged so the feature owns its own data flow. The local model now matches the hashes endpoint response instead of carrying the old store's dead fields around. Co-authored-by: Codex GPT-5 <noreply@openai.com>
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.62% |
Remove the local provider/context now that the state only feeds a small component tree. The view owns the query and reducer hooks, then passes the few values the toolbar and rows need. Also drops a couple leftovers from the old store migration: the identity parser and the unused fingerprint argument on initial state. Co-authored-by: Codex GPT-5 <noreply@openai.com>
trim a few implementation-y assertions from the grouping store migration tests. The specs still cover the useful row state behavior and rendered merged fingerprints, without adding loading state coverage. Co-authored-by: Codex GPT-5 <noreply@openai.com>
|
|
||
| return { | ||
| ...state, | ||
| fingerprintState: setFingerprintState( | ||
| state.fingerprintState, | ||
| action.fingerprintIds, | ||
| {checked: false, busy: true} | ||
| ), | ||
| unmergeList, | ||
| }; | ||
| } |
There was a problem hiding this comment.
Bug: After a successful unmerge, the busy state is incorrectly set to true instead of false, permanently disabling the UI row for the unmerged item.
Severity: MEDIUM
Suggested Fix
In the unmergeSuccess case within the reducer, update the setFingerprintState call to set busy: false. This will ensure that after a successful unmerge operation, the item's UI row returns to an interactive state.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/issueDetails/groupMerged/useGroupMerged.tsx#L161-L174
Potential issue: In the reducer within `useGroupMerged.tsx`, the `unmergeSuccess` case
incorrectly sets the `busy` state to `true` instead of `false`. When a user successfully
unmerges an item, its state is permanently marked as busy. This causes the corresponding
UI row to become disabled and visually faded, preventing the user from interacting with
it again. The logic for the `unmergeError` case correctly sets `busy: false`,
highlighting the logical error in the success path.
Did we get this right? 👍 / 👎 to inform future reviews.
| } | ||
|
|
||
| const unmergeDisabledReason = | ||
| mergedItems.length <= 1 | ||
| fingerprints.length <= 1 | ||
| ? t('To unmerge, the list must contain 2 or more items') |
There was a problem hiding this comment.
Bug: The disabled reason for the unmerge button is misleading because the logic for the disabled state and the reason message use different fingerprint lists, causing an inconsistency.
Severity: LOW
Suggested Fix
Align the logic for unmergeDisabledReason with the logic for unmergeDisabled. The check for the number of items in mergedToolbar.tsx should use fingerprintsWithLatestEvent.length instead of fingerprints.length to ensure the disabled reason accurately reflects the state.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/issueDetails/groupMerged/mergedToolbar.tsx#L64-L68
Potential issue: There is an inconsistency between the logic that disables the 'unmerge'
button and the logic that generates the tooltip explaining why it's disabled. This
occurs when some fingerprints have a null `latestEvent` due to data retention policies.
The `unmergeDisabled` flag correctly uses a filtered list of fingerprints
(`fingerprintsWithLatestEvent`), while the `unmergeDisabledReason` message logic uses
the full, unfiltered `fingerprints` list. This can lead to a scenario where the button
is disabled because there's only one item available to unmerge, but the tooltip
incorrectly states that the user needs to select an item, creating a confusing user
experience.
Also affects:
static/app/views/issueDetails/groupMerged/mergedToolbar.tsx:83~89
The merged fingerprints tab was using a Reflux store even though every real caller lived in the same issue details area. This moves the endpoint query and local UI state into groupMerged so the feature owns its own data flow. The local model now matches the hashes endpoint response instead of carrying the old store's dead fields around.
The merged fingerprints tab was using a Reflux store even though every real caller lived in the same issue details area. This moves the endpoint query and local UI state into groupMerged so the feature owns its own data flow. The local model now matches the hashes endpoint response instead of carrying the old store's dead fields around.
The merged fingerprints tab was using a Reflux store even though every real caller lived in the same issue details area. This moves the endpoint query and local UI state into groupMerged so the feature owns its own data flow.
The local model now matches the hashes endpoint response instead of carrying the old store's dead fields around.