bbdf4db2c3d6c72bc109a9f478870ad711e1a11d
braney
  Tue Oct 21 09:48:50 2025 -0700
remove cart visibilities for tracks in hub when disconnecting refs #36536

diff --git src/hg/lib/cart.c src/hg/lib/cart.c
index f53e0c2c84f..98cbf7baf8b 100644
--- src/hg/lib/cart.c
+++ src/hg/lib/cart.c
@@ -1391,30 +1391,34 @@
 {
 char *id = cartOptionalString(cart, "hubId");
 
 if (id != NULL)
     {
     char buffer[1024];
     safef(buffer, sizeof buffer, "hgHubConnect.hub.%s", id);
     cartRemove(cart, buffer);
 
     safef(buffer, sizeof buffer, "quickLift.%s", id);
     cartRemovePrefix(cart, buffer);
 
     // now we need to remove any custom tracks that are on this hub
     safef(buffer, sizeof buffer, "ctfile_hub_%s", id);
     cartRemovePrefix(cart, buffer);
+
+    // remove any visibilities in the cart
+    safef(buffer, sizeof buffer, "hub_%s", id);
+    cartRemovePrefix(cart, buffer);
     }
 
 cartRemove(cart, "hubId");
 cartRemove(cart, hgHubDoDisconnect);
 }
 
 static void hideIfNotInCart(struct cart *cart, char *track)
 /* If this track is not mentioned in the cart, set it to hide */
 {
 if (cartOptionalString(cart, track) == NULL)
     cartSetString(cart, track, "hide");
 }
 
 void cartHideDefaultTracks(struct cart *cart)
 /* Hide all the tracks who have default visibilities in trackDb