nick-boss-tech opened a new pull request, #5282:
URL: https://github.com/apache/solr/pull/5282

   🤖 *AI text below* 🤖 *(reviewed by Nick Shanin)*
   
   Draft status is due to Nick Shanin's open-PR cap; the change is complete and 
ready for review.
   
   Jira: https://issues.apache.org/jira/browse/SOLR-16398
   
   @epugh This is the dedicated Admin UI PR for the `showCollection` problem 
traced on #5265.
   
   **What happens today**
   
   The collection selector can call `showCollection` with no collection while 
the navigation menu is refreshing.
   
   In 
[`app.js`](https://github.com/apache/solr/blob/6ee3c9b6370e6e1e3b4da4afcf968a0806cc747f/solr/webapp/web/js/angular/app.js),
 `MainController.resetMenu` deletes `$scope.currentCollection` before the 
chained `CollectionsV2.listCollections` and `AliasesV2.getAliases` calls 
resolve. The top navigation selector in `index.html` binds directly to 
`currentCollection` and calls `showCollection(currentCollection)` on change, so 
the handler fires with an undefined collection and then fails when it reads 
`collection.type`. Eric Pugh traced this deterministic sequence on #5265: 
https://github.com/apache/solr/pull/5265#issuecomment-6607267690
   
   **What this change does**
   
   The refresh keeps the previous selection until the refreshed lists are in 
hand, and `showCollection` ignores an empty selection.
   
   * `resetMenu` no longer deletes `$scope.currentCollection` before the 
asynchronous list and alias calls. The delete moves into the alias callback, 
after a successful response and before the rebuilt alias and collection lists 
are matched against the current page.
   * `showCollection` returns early when no collection is passed. The 
neighboring `showCore` handler already has the same shape of guard.
   
   **Proof**
   
   The code path was re-read at `6ee3c9b6370e6e1e3b4da4afcf968a0806cc747f`, and 
the only caller of `showCollection` is the `ng-change` binding in `index.html`.
   
   * `node --check solr/webapp/web/js/angular/app.js` passes at 
`6ee3c9b6370e6e1e3b4da4afcf968a0806cc747f`.
   * The failure sequence is the deterministic page-load sequence Eric traced 
on #5265, not a new test-only construction.
   
   **Limits**
   
   No automated browser run was done for this legacy Angular UI change on this 
host. The parallel `$scope.currentCore` refresh has a similar 
delete-before-refresh shape, but `showCore` already guards an empty value; that 
path is left untouched to keep this PR to the collection selector problem from 
#5265.
   
   *Nick Shanin directed the work and takes responsibility for this 
contribution.*
   


-- 
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