{"action":"created","issue":{"url":"https://api.github.com/repos/evantahler/actionhero/issues/561","labels_url":"https://api.github.com/repos/evantahler/actionhero/issues/561/labels{/name}","comments_url":"https://api.github.com/repos/evantahler/actionhero/issues/561/comments","events_url":"https://api.github.com/repos/evantahler/actionhero/issues/561/events","html_url":"https://github.com/evantahler/actionhero/issues/561","id":54346855,"number":561,"title":"`_originalConnection` is consufing and complicated.  It makes it hard to modify persistent connection properties.","user":{"login":"evantahler","id":303226,"avatar_url":"https://avatars.githubusercontent.com/u/303226?v=3","gravatar_id":"","url":"https://api.github.com/users/evantahler","html_url":"https://github.com/evantahler","followers_url":"https://api.github.com/users/evantahler/followers","following_url":"https://api.github.com/users/evantahler/following{/other_user}","gists_url":"https://api.github.com/users/evantahler/gists{/gist_id}","starred_url":"https://api.github.com/users/evantahler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantahler/subscriptions","organizations_url":"https://api.github.com/users/evantahler/orgs","repos_url":"https://api.github.com/users/evantahler/repos","events_url":"https://api.github.com/users/evantahler/events{/privacy}","received_events_url":"https://api.github.com/users/evantahler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/evantahler/actionhero/labels/medium","name":"medium","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/evantahler/actionhero/milestones/3","labels_url":"https://api.github.com/repos/evantahler/actionhero/milestones/3/labels","id":930828,"number":3,"title":"v11.0.0","description":"## Topics:\r\n\r\n- refactor the way middleware is handled so that actions choose what sections they want to invoke\r\n- remove _original connection from the actionProcessor","creator":{"login":"evantahler","id":303226,"avatar_url":"https://avatars.githubusercontent.com/u/303226?v=3","gravatar_id":"","url":"https://api.github.com/users/evantahler","html_url":"https://github.com/evantahler","followers_url":"https://api.github.com/users/evantahler/followers","following_url":"https://api.github.com/users/evantahler/following{/other_user}","gists_url":"https://api.github.com/users/evantahler/gists{/gist_id}","starred_url":"https://api.github.com/users/evantahler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantahler/subscriptions","organizations_url":"https://api.github.com/users/evantahler/orgs","repos_url":"https://api.github.com/users/evantahler/repos","events_url":"https://api.github.com/users/evantahler/events{/privacy}","received_events_url":"https://api.github.com/users/evantahler/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":2,"state":"open","created_at":"2015-01-12T00:52:57Z","updated_at":"2015-01-25T23:18:21Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-01-14T16:58:31Z","updated_at":"2015-02-24T01:56:20Z","closed_at":null,"body":"- Do we really need `_originalConnection` in middleware / actions?\r\n- How can we better deal with connection property changes?"},"comment":{"url":"https://api.github.com/repos/evantahler/actionhero/issues/comments/75684340","html_url":"https://github.com/evantahler/actionhero/issues/561#issuecomment-75684340","issue_url":"https://api.github.com/repos/evantahler/actionhero/issues/561","id":75684340,"user":{"login":"evantahler","id":303226,"avatar_url":"https://avatars.githubusercontent.com/u/303226?v=3","gravatar_id":"","url":"https://api.github.com/users/evantahler","html_url":"https://github.com/evantahler","followers_url":"https://api.github.com/users/evantahler/followers","following_url":"https://api.github.com/users/evantahler/following{/other_user}","gists_url":"https://api.github.com/users/evantahler/gists{/gist_id}","starred_url":"https://api.github.com/users/evantahler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantahler/subscriptions","organizations_url":"https://api.github.com/users/evantahler/orgs","repos_url":"https://api.github.com/users/evantahler/repos","events_url":"https://api.github.com/users/evantahler/events{/privacy}","received_events_url":"https://api.github.com/users/evantahler/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T01:56:20Z","updated_at":"2015-02-24T01:56:20Z","body":"I'll add some code soon in a PR we can talk about (talking in the abstract is hard).  Basically, more and more folks expect changes to the `connection` object to persist.  Middleware doing `connection.authorized = true; connection.userId = 123` is expected to work.  While the `_originalConnection` stuck was a hack to expose the underlying object, I do think we can do better ro reduce confusion for new folks. \r\n\r\nIn @slattery's examples, you would still have access to `connection.rawConnection` and fingerprint would promote to `connection.fingerprint`.\r\n\r\nThe reason for _originalConnection was to pass a \"snapshot\" of the state of the params to each action, but if we split out the snapshot as a separate argument to the middleware and actions (see above psudeo code), there's no reason to make the snapshot. "}}