{"action":"created","issue":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1258","repository_url":"https://api.github.com/repos/HubTurbo/HubTurbo","labels_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1258/labels{/name}","comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1258/comments","events_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1258/events","html_url":"https://github.com/HubTurbo/HubTurbo/pull/1258","id":133744217,"number":1258,"title":"Recover from failed labels replace #1246","user":{"login":"ndt93","id":5065989,"avatar_url":"https://avatars.githubusercontent.com/u/5065989?v=3","gravatar_id":"","url":"https://api.github.com/users/ndt93","html_url":"https://github.com/ndt93","followers_url":"https://api.github.com/users/ndt93/followers","following_url":"https://api.github.com/users/ndt93/following{/other_user}","gists_url":"https://api.github.com/users/ndt93/gists{/gist_id}","starred_url":"https://api.github.com/users/ndt93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndt93/subscriptions","organizations_url":"https://api.github.com/users/ndt93/orgs","repos_url":"https://api.github.com/users/ndt93/repos","events_url":"https://api.github.com/users/ndt93/events{/privacy}","received_events_url":"https://api.github.com/users/ndt93/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/labels/status.toReview","name":"status.toReview","color":"669966"}],"state":"open","locked":false,"assignee":{"login":"dariusf","id":4328341,"avatar_url":"https://avatars.githubusercontent.com/u/4328341?v=3","gravatar_id":"","url":"https://api.github.com/users/dariusf","html_url":"https://github.com/dariusf","followers_url":"https://api.github.com/users/dariusf/followers","following_url":"https://api.github.com/users/dariusf/following{/other_user}","gists_url":"https://api.github.com/users/dariusf/gists{/gist_id}","starred_url":"https://api.github.com/users/dariusf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dariusf/subscriptions","organizations_url":"https://api.github.com/users/dariusf/orgs","repos_url":"https://api.github.com/users/dariusf/repos","events_url":"https://api.github.com/users/dariusf/events{/privacy}","received_events_url":"https://api.github.com/users/dariusf/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-02-15T15:42:38Z","updated_at":"2016-02-16T09:11:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1258","html_url":"https://github.com/HubTurbo/HubTurbo/pull/1258","diff_url":"https://github.com/HubTurbo/HubTurbo/pull/1258.diff","patch_url":"https://github.com/HubTurbo/HubTurbo/pull/1258.patch"},"body":"Fixes #1246.\r\n\r\n* Mitigate some concurrency issues by synchronising various methods in `Model`, `MultiModel` and `TurboIssue` and using issue lookup in models.\r\n>The root cause for this is that `MultiModel` is not properly synchronised i.e. although its methods are synchronised, its internal states can be retrieved and read/modified somewhere else, technically changing the `MultiModel`'s state without synchronisation. An example is that we can assign labels to a dangling `TurboIssue` out of nowhere and the models' state and `Ui` is changed. The `queue` helps to solve this by making the end-to-end operation on `MultiModel` mutually execlusive. However the operation includes incremental steps of downloading and local models update, which cause other operations to be laggy. So a solution that doesn't trades off speed or correctness involves seperating the end-to-end download and end-to-end local updates, which would requires major changes and planning.\r\n\r\n* Reconciling labels updates from GitHub and local changes using physical time timestamp. This requires all mutating actions on labels to update the timestamp. Making the labels getter return a new list leads to regression so this is probably violated somewhere by codes that get the labels list and modify it directly.\r\n\r\n* Display error message and reverting to previous labels if failed to update on GitHub. This is also achieved through the labels modification timestamps. I was intending to have a `Retry` dialog box but that needs changes up at the `UI` level which probably conflicts with the current labels picker refactoring."},"comment":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/comments/184588883","html_url":"https://github.com/HubTurbo/HubTurbo/pull/1258#issuecomment-184588883","issue_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1258","id":184588883,"user":{"login":"dariusf","id":4328341,"avatar_url":"https://avatars.githubusercontent.com/u/4328341?v=3","gravatar_id":"","url":"https://api.github.com/users/dariusf","html_url":"https://github.com/dariusf","followers_url":"https://api.github.com/users/dariusf/followers","following_url":"https://api.github.com/users/dariusf/following{/other_user}","gists_url":"https://api.github.com/users/dariusf/gists{/gist_id}","starred_url":"https://api.github.com/users/dariusf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dariusf/subscriptions","organizations_url":"https://api.github.com/users/dariusf/orgs","repos_url":"https://api.github.com/users/dariusf/repos","events_url":"https://api.github.com/users/dariusf/events{/privacy}","received_events_url":"https://api.github.com/users/dariusf/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T09:11:45Z","updated_at":"2016-02-16T09:11:45Z","body":"I'm wondering if we should move towards the big change of separating the whole stream of updates into two. While this is a nice solution to the problem given the current tradeoffs, it's quite complex to extend correctly, and will get even more so as requirements change."}}