 
 (defmethod handle-event :session/state
   [[_ state] app owner]
-  (om/update! app [:session/state] state))
+  (js/alert (str "session/state: " (name state)))
+  (om/set-state! owner :session/state state))
 
 (defmethod handle-event :auth/fail
   [_ app owner]

                             (dom/button #js {:onClick #(login % app owner)}
                                        "Login"))))))

(defn app-view [app owner]
  (reify
    om/IWillMount
    (will-mount [this]
                (event-loop app owner)
                (when (= :unknown (:session/state app))
                  (js/alert "will-mount send session/status query")
                  (chsk-send! [:session/status])))
    om/IRender
    (render [this]
            (js/alert "render app")
            (if (= :secure (:session/state app))
              (dom/div nil
                       (dom/h1 nil "Test Sente")
                       (om/build field-view app {:opts {:name "data"}})
                       (om/build data-view app {}))
              (om/build login-view app {})))))

(def app-state (atom {:session/state :unknown}))

(om/root app-view
         app-state

(defmethod handle-event :auth/success
  [_ app owner]
  (om/update! app [:notify/error] nil)
  (om/set-state! owner :session/state :secure))

(defn event-loop [app owner]
  (go (loop []
