anchor.diff:                  )
               after
                   couch_db_update_notifier:stop(Notify),
  -                get_rest_db_updated() % clean out any remaining update messages
  +                get_rest_db_updated(ok) % clean out any remaining update messages
               end
           end;
       true ->
  -        fun(Callback) ->
  -            start_sending_changes(Callback, Args#changes_args.feed),
  -            {ok, {_, LastSeq, _Prepend, _, _, _, _, _}} =
  +        fun(CallbackAcc) ->
  +            {Callback, UserAcc} = get_callback_acc(CallbackAcc),
  +            UserAcc2 = start_sending_changes(Callback, UserAcc, Feed),
  +            {ok, {_, LastSeq, _Prepend, _, _, UserAcc3, _, _, _}} =
                   send_changes(
                       Args#changes_args{feed="normal"},
                       Callback,
  +                    UserAcc2,
                       Db,
                       StartSeq,
  -                    <<"">>
  +                    <<>>
                   ),
  -            end_sending_changes(Callback, LastSeq, Args#changes_args.feed)
  +            end_sending_changes(Callback, UserAcc3, LastSeq, Feed)
           end
       end.
  +
  +get_callback_acc({Callback, _UserAcc} = Pair) when is_function(Callback, 3) ->
  +    Pair;
  +get_callback_acc(Callback) when is_function(Callback, 2) ->
  +    {fun(Ev, Data, _) -> Callback(Ev, Data) end, ok}.
   
   %% @type Req -> #httpd{} | {json_req, JsonObj()}
   make_filter_fun(FilterName, Style, Req, Db) ->
  
positive.code:         StartSeq,
          fun changes_enumerator/2,
          [{dir, Dir}],
          {Db, StartSeq, Prepend, FilterFun, Callback, ResponseType, Limit,
              IncludeDocs}
      ).
  
  keep_sending_changes(Args, Callback, Db, StartSeq, Prepend, Timeout,
      TimeoutFun) ->
      #changes_args{
          feed = ResponseType,
  
negative.code:         db_open_options = DbOptions
      } = Args,
      % ?LOG_INFO("send_changes start ~p",[StartSeq]),
      {ok, {_, EndSeq, Prepend2, _, _, UserAcc2, _, NewLimit, _}} = send_changes(
          Args#changes_args{dir=fwd}, Callback, UserAcc, Db, StartSeq, Prepend
      ),
      % ?LOG_INFO("send_changes last ~p",[EndSeq]),
      couch_db:close(Db),
      if Limit > NewLimit, ResponseType == "longpoll" ->
          end_sending_changes(Callback, UserAcc2, EndSeq, ResponseType);
      true ->
          case wait_db_updated(Timeout, TimeoutFun, UserAcc2) of
          {updated, UserAcc3} ->
              % ?LOG_INFO("wait_db_updated updated ~p",[{Db#db.name, EndSeq}]),
              DbOptions1 = [{user_ctx, Db#db.user_ctx} | DbOptions],
              case couch_db:open(Db#db.name, DbOptions1) of
  