These are chat archives for damianh/Cedar

15th
Jun 2015
Dennis Doomen
@dennisdoomen
Jun 15 2015 08:38
@damianh Why did you decide to use PUT as the default verb for sending commands instead of POST? In IIS environments, PUT is a bit troublesome. You need to enable it explicitly and make sure you disable WebDAV. It has cost us quite some time to figure that out.
Damian Hickey
@damianh
Jun 15 2015 09:20
Idempotency semantics
PUT the same command twice, will give you the same result
We treat commands as resources in their own right. http://stackoverflow.com/a/630475/1010 "PUT is idempotent, so if you PUT an object twice, it has no effect. This is a nice property, so I would use PUT when possible."
Dennis Doomen
@dennisdoomen
Jun 15 2015 09:54
Is that a convention?
Damian Hickey
@damianh
Jun 15 2015 10:05
Though.. am open to the idea of allowing POST handling though, as a config option.
João Bragança
@thefringeninja
Jun 15 2015 10:10
POST can be made idempotent but it's not guaranteed to be so. means that clients / proxies are not safe to retry a POST after some network failure
@damianh have you started on the polling client yet
Damian Hickey
@damianh
Jun 15 2015 10:11
No, can you do a stab at one over the existing API?
João Bragança
@thefringeninja
Jun 15 2015 10:11
sure. i'll bake it somewhere
just so we're clear, we want to pass in callback delegates like OnEventAppeared OnException etc like ges's api right?
Damian Hickey
@damianh
Jun 15 2015 10:12
Yes via call backs + async.
Not IObservable<>
Dennis Doomen
@dennisdoomen
Jun 15 2015 10:41
Well, POST will make it more IIS-friendly, which is a given for us.
João Bragança
@thefringeninja
Jun 15 2015 10:43
you can always stick something in front
Dennis Doomen
@dennisdoomen
Jun 15 2015 10:43
Which would defy the purpose of using Cedar in the first place: use something that's there
João Bragança
@thefringeninja
Jun 15 2015 11:04
it's the owin pipeline. about 6 lines of code...
Damian Hickey
@damianh
Jun 15 2015 11:27
@thefringeninja I'd still have to adjust the controller.
IIS here is the problem, that is what needs to be adjusted.
João Bragança
@thefringeninja
Jun 15 2015 11:31
.Map("/commands", builder.Use(next => async env => 
{
    var context = new OwinContext(env);
    if (context.Request.Method == "POST")
    {
        context.Request.Method = "PUT";

        await next(env);
    }
}));
what am I missing
@thefringeninja are you using the lasted CI build?
João Bragança
@thefringeninja
Jun 15 2015 11:33
probably not
surely it can't be more complicated than changing the request method on a certain enpoint and passing it to the rest of the pipeline
Damian Hickey
@damianh
Jun 15 2015 11:34
do an update, includes latest bits on command / content type mapping, need feedback.
João Bragança
@thefringeninja
Jun 15 2015 11:34
k
Damian Hickey
@damianh
Jun 15 2015 11:34
ty
Wait, I get you... convert the post to a PUT is a workarond
I was reading it as other way around
derp :)
:thumbsup:
João Bragança
@thefringeninja
Jun 15 2015 11:35
that's what i'm here for
Damian Hickey
@damianh
Jun 15 2015 11:35
hahah
what's the workaround for the client lib... hm
João Bragança
@thefringeninja
Jun 15 2015 11:36
a gist that defines a new extension method
Damian Hickey
@damianh
Jun 15 2015 11:40
@dennisdoomen I hope you understand that a library needs to stick to it's principals. Including workarounds in the lib itself for other broken stuff (in this case some default IIS config), is not desirable / appropriate.
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:01
Depends. Is the library supposed to help solve our business problems, or somebody else's?
Damian Hickey
@damianh
Jun 15 2015 13:02
This library solves a problem. Whether it matches your business problem or not is for you to evaluate.
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:32
What I'm saying is that I love to use as much of what's there, provided that I don't have to do too much plumbing myself.
João Bragança
@thefringeninja
Jun 15 2015 13:34
do 6 statements qualify as 'too much plumbing?'
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:34
Anyway, was just wondering why you stuck to PUT rather than POST.
You're solution is pretty neat.
But how would we solve the client library? Create our own overload?
João Bragança
@thefringeninja
Jun 15 2015 13:38
yes, it's just an extension method. invoke Cedar.CommandHandling.Http.CommandClient.CreatePutCommandRequest yourself, change the request method to POST
client.PutCommand doesn't really do much
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:38
Will do.
so it's 16 statements or so when you include the client
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:39
@damianh is that PR that allows custom mapping between a command type and the way it is seralized already on the CI package?
Damian Hickey
@damianh
Jun 15 2015 13:43
I'll wiki this work around.
@dennisdoomen yes
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:43
Thanks
Damian Hickey
@damianh
Jun 15 2015 13:45
As this is a HTTP first API, I want to stick to HTTP semantics. PUT means idempotency. In CQRS, idempotency is a key system attribute.
POST does not imply idempotency.
João Bragança
@thefringeninja
Jun 15 2015 13:46
ok so I updated to -build159 @damianh
getting compilation errors now, HttpProblemDetails exists in multiple assemblies
Damian Hickey
@damianh
Jun 15 2015 13:47
@thefringeninja checking now.
João Bragança
@thefringeninja
Jun 15 2015 13:47
my middleware project is referencing Http.dll and Http.Client.dll
should I not be doing that
Damian Hickey
@damianh
Jun 15 2015 13:47
yes
unless you want a .common dll that the Http and Client reference?
João Bragança
@thefringeninja
Jun 15 2015 13:48
so just reference Http.dll?
Dennis Doomen
@dennisdoomen
Jun 15 2015 13:48
I agree with idempotency. Didn't know about these differences.
Damian Hickey
@damianh
Jun 15 2015 13:48
@thefringeninja no, you need both.
João Bragança
@thefringeninja
Jun 15 2015 13:48
well then, I guess we're at a crossroads.
:trollface:
Damian Hickey
@damianh
Jun 15 2015 13:48
Am checking dude
The client assembly also contains the 'common stuff'
@thefringeninja spotted problem, bad ilmerge, 2 mins
João Bragança
@thefringeninja
Jun 15 2015 13:53
it's always ilmerge
Damian Hickey
@damianh
Jun 15 2015 13:54
when in doubt
It's was my derp oc
Damian Hickey
@damianh
Jun 15 2015 13:59
@thefringeninja build 162 up
João Bragança
@thefringeninja
Jun 15 2015 13:59
Get-Package Cedar.CommandHandling | %{ $_.Id} | Select-Object -Unique | %{ Update-Package -Id $_ -pre -version 1.0.0-build00162 -IgnoreDependencies }
thank goodness for powershell :worried:
Damian Hickey
@damianh
Jun 15 2015 13:59
Prefectly cromulent
João Bragança
@thefringeninja
Jun 15 2015 14:01
ResolveCommandType signature has changed
where do we deal with versioning
Damian Hickey
@damianh
Jun 15 2015 14:01
Yep
João Bragança
@thefringeninja
Jun 15 2015 14:05
CommandThatHasASyncHandler, CommandThatHasAnAsyncHandler hahaha