passing in event handlers is obviously going to be the most common
usage (all apps won't necessarily need to change the default options,
though many will want to). so it seems silly to hide the event handlers
as an option... i feel like it's better as it's own separate
argument.
this is part of the browserchannel protocol and can be an optimization
for some applications (less round trips to the server when the app is
establishing the browserchannel session)
the way this was being triggered would cause the session timeout to
be triggered at the proper timeout interval, but due to the call
to refresh-session-timeout not being done via the session agent and
the use of send-off, the session timeout handler would not have any
way to actually remove the session from the global sessions atom
in practice this would only actually be a problem if clients were
creating a session and then never performing a GET request to create
a backchannel
i personally think this was an important change as the default encoding
of maps to be sent as json is somewhat lossy (keywords converted to
strings, would never be able to get this 100% perfect using json alone
without a more complex encoding solution). encoding to edn is the
perfect solution to this.
since browserchannel pretty much requires the final sent data to be
json encoded, we just serialize the clojure data being sent to an
edn string within a root json object.
this does ultimately mean we have to do a little bit of pre-parsing
of sent and received maps to encode/decode properly and make it
completely transparent to application code, but i think it's an
acceptable tradeoff.
i apologize to anyone looking at this commit and wondering why i would
do this, but all these little "off" formatting things have been bugging
me all day while looking at this code. i simply had to do something.