{"action":"closed","issue":{"url":"https://api.github.com/repos/pomm-project/Foundation/issues/38","labels_url":"https://api.github.com/repos/pomm-project/Foundation/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/pomm-project/Foundation/issues/38/comments","events_url":"https://api.github.com/repos/pomm-project/Foundation/issues/38/events","html_url":"https://github.com/pomm-project/Foundation/issues/38","id":73322024,"number":38,"title":"Converter registration in Session fails for repeated registration of any converter","user":{"login":"xenji","id":102154,"avatar_url":"https://avatars.githubusercontent.com/u/102154?v=3","gravatar_id":"","url":"https://api.github.com/users/xenji","html_url":"https://github.com/xenji","followers_url":"https://api.github.com/users/xenji/followers","following_url":"https://api.github.com/users/xenji/following{/other_user}","gists_url":"https://api.github.com/users/xenji/gists{/gist_id}","starred_url":"https://api.github.com/users/xenji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xenji/subscriptions","organizations_url":"https://api.github.com/users/xenji/orgs","repos_url":"https://api.github.com/users/xenji/repos","events_url":"https://api.github.com/users/xenji/events{/privacy}","received_events_url":"https://api.github.com/users/xenji/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-05-05T13:56:58Z","updated_at":"2015-05-06T09:29:40Z","closed_at":"2015-05-06T09:29:40Z","body":"Setup:\r\n- PHP 5.6\r\n- Thrift (via overblog/thrift bundle)\r\n- The thrift server is started as socket server in an event loop\r\n\r\nMethod (simplified for the use-case):\r\n```php\r\n    /**\r\n     * @param string $name\r\n     *\r\n     * @return bool\r\n     * @author Mario Mueller\r\n     */\r\n    public function existsByName($name)\r\n    {\r\n        $session = $this->db->getSession($this->userSession);\r\n        $userModel = new UsersModel();\r\n        $userModel->initialize($session); // This fails for repeated calls in the same event loop\r\n        return $userModel->existWhere('username=$*', [$name]);\r\n    }\r\n```\r\n\r\nProblem: \r\nDue to the event loop, the session does not get unloaded, so any custom converters are able to be added again. The `initialize(Session $session)` function mutates the session-related converters, this leads to an exception on the second request to the thrift server. \r\n\r\nDesired behaviour:\r\nThe session should check for the presence of the converter to add and either skip it or add it and make the list unique afterwards (what ever is more performant)."}}