             all-fields  (clojure.set/union   fields-as-set   existing-fields-as-set)
             all-fields-as-vector (into [] all-fields)
             ]
-        (if (not (= all-fields existing-fields-as-set))
+        (if (not (= all-fields  existing-fields-as-set))
           (do
-            (swap! client-datasource-fields  assoc  data-source  (atom all-fields))))))))
+            (log (str "     " existing-fields-as-set " -> " all-fields))
+            (swap! client-datasource-fields  assoc  data-source  (atom all-fields))
+            (clear-client-table-caches-for  data-source)
+            ))))))
 
 
 

                              }
        ]

    (keep-client-fields-up-tp-date   data-source  fields)






;zzz
(defn clear-client-table-caches-for  [db-table]
  (log (str  "********************clear-client-table-caches-for: " db-table ":" (keys @(:values @(get @client-record-cache  (keyword db-table))))))

  (doall (map
    (fn [x]
      (go
        (let [
               record-request     {:source              (keyword db-table)
                                   :db-table            (name db-table)
                                   :fields              (get-default-fields-for-data-source  db-table)
                                   :id                   x
                                   :data-session-id     @data-session-id
                                   :realtime            true
                                   :force               true
                                   }]
          (log "*************    :" record-request)
          (>! client-record-cache-requests   record-request))))

      (keys @(:values @(get @client-record-cache  (keyword db-table))))
    ))

  nil
  )



