{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/netbout/issues/1094","repository_url":"https://api.github.com/repos/yegor256/netbout","labels_url":"https://api.github.com/repos/yegor256/netbout/issues/1094/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/netbout/issues/1094/comments","events_url":"https://api.github.com/repos/yegor256/netbout/issues/1094/events","html_url":"https://github.com/yegor256/netbout/pull/1094","id":143353584,"number":1094,"title":"#834: NoSuchElementException: no more items in the frame, position=-1 strikes back","user":{"login":"2686747","id":8187855,"avatar_url":"https://avatars.githubusercontent.com/u/8187855?v=3","gravatar_id":"","url":"https://api.github.com/users/2686747","html_url":"https://github.com/2686747","followers_url":"https://api.github.com/users/2686747/followers","following_url":"https://api.github.com/users/2686747/following{/other_user}","gists_url":"https://api.github.com/users/2686747/gists{/gist_id}","starred_url":"https://api.github.com/users/2686747/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2686747/subscriptions","organizations_url":"https://api.github.com/users/2686747/orgs","repos_url":"https://api.github.com/users/2686747/repos","events_url":"https://api.github.com/users/2686747/events{/privacy}","received_events_url":"https://api.github.com/users/2686747/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yegor256/netbout/labels/15%20mins","name":"15 mins","color":"eb6421"},{"url":"https://api.github.com/repos/yegor256/netbout/labels/@original-brownbear","name":"@original-brownbear","color":"009801"},{"url":"https://api.github.com/repos/yegor256/netbout/labels/CR","name":"CR","color":"bfd4f3"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2016-03-24T20:40:34Z","updated_at":"2016-03-27T16:57:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yegor256/netbout/pulls/1094","html_url":"https://github.com/yegor256/netbout/pull/1094","diff_url":"https://github.com/yegor256/netbout/pull/1094.diff","patch_url":"https://github.com/yegor256/netbout/pull/1094.patch"},"body":"#834: added catching unexpected exceptions.\r\nProblem occurs when user was kicked from bout. It seems like there is  a problem with caching. Normally logic in `TkIndex.act() ` will check user in current bout and throw `RsFailure` or `HttpException`. These exceptions will be processed and user will be redirected to home page with error message. With current cache settings when 5 minutes pass this logic still process user as bout's participant but later in code (`DyMessages.unread()` exactly) application try fetch data for current user from database and doesn't find it (because user was kicked >5min ago). Unchecked iteration throws `NoSuchElementException extends RuntimeException` and user see stacktrace. Solution:   if `DyMessages.unread()` processes kicked user throw `Inbox.BoutNotFoundException`,  catch it later in appropriate place (`TkIndex`) and redirect user to home page with exception `RsFailure` and \"_page not found_\" message."},"comment":{"url":"https://api.github.com/repos/yegor256/netbout/issues/comments/202103570","html_url":"https://github.com/yegor256/netbout/pull/1094#issuecomment-202103570","issue_url":"https://api.github.com/repos/yegor256/netbout/issues/1094","id":202103570,"user":{"login":"original-brownbear","id":6490959,"avatar_url":"https://avatars.githubusercontent.com/u/6490959?v=3","gravatar_id":"","url":"https://api.github.com/users/original-brownbear","html_url":"https://github.com/original-brownbear","followers_url":"https://api.github.com/users/original-brownbear/followers","following_url":"https://api.github.com/users/original-brownbear/following{/other_user}","gists_url":"https://api.github.com/users/original-brownbear/gists{/gist_id}","starred_url":"https://api.github.com/users/original-brownbear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/original-brownbear/subscriptions","organizations_url":"https://api.github.com/users/original-brownbear/orgs","repos_url":"https://api.github.com/users/original-brownbear/repos","events_url":"https://api.github.com/users/original-brownbear/events{/privacy}","received_events_url":"https://api.github.com/users/original-brownbear/received_events","type":"User","site_admin":false},"created_at":"2016-03-27T16:57:16Z","updated_at":"2016-03-27T16:57:16Z","body":"@2686747 I addressed your explanations. Also please try to fix the things you agree with (reverting the one file in this case) before continuing the discussion. Otherwise it becomes harder and harder to follow things, because GitHub does not hide the outdated parts of the discussion yet."}}