codeant-ai-for-open-source[bot] commented on code in PR #40968:
URL: https://github.com/apache/superset/pull/40968#discussion_r3395329664


##########
superset-frontend/src/core/views/index.ts:
##########
@@ -75,6 +75,11 @@ const registerView: typeof viewsApi.registerView = (
   viewRegistry.set(id, { view, location, provider });
 
   const ids = locationIndex.get(location) ?? new Set();
+  // Re-registering an existing id must reflect its new recency. A Set 
preserves
+  // first-insertion order and `add` is a no-op for an existing member, so 
delete
+  // first to move the id to the end. Consumers that select the most-recently
+  // registered view (e.g. the chatbot resolver) depend on this ordering.
+  ids.delete(id);
   ids.add(id);

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag stale-disposal or re-registration safety issues in the view 
registry unless a runtime dispose/deactivate path exists; in the current 
architecture, view registrations are reset on full page reload and 
re-registration is not a supported runtime flow.
   
   **Applied to:**
     - `superset-frontend/src/core/views/**`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to