{"action":"created","issue":{"url":"https://api.github.com/repos/openshiftio/openshift.io/issues/3705","repository_url":"https://api.github.com/repos/openshiftio/openshift.io","labels_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/3705/labels{/name}","comments_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/3705/comments","events_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/3705/events","html_url":"https://github.com/openshiftio/openshift.io/issues/3705","id":328240050,"node_id":"MDU6SXNzdWUzMjgyNDAwNTA=","number":3705,"title":"Widgets show loading state after environment reset","user":{"login":"dlabrecq","id":17481322,"node_id":"MDQ6VXNlcjE3NDgxMzIy","avatar_url":"https://avatars2.githubusercontent.com/u/17481322?v=4","gravatar_id":"","url":"https://api.github.com/users/dlabrecq","html_url":"https://github.com/dlabrecq","followers_url":"https://api.github.com/users/dlabrecq/followers","following_url":"https://api.github.com/users/dlabrecq/following{/other_user}","gists_url":"https://api.github.com/users/dlabrecq/gists{/gist_id}","starred_url":"https://api.github.com/users/dlabrecq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlabrecq/subscriptions","organizations_url":"https://api.github.com/users/dlabrecq/orgs","repos_url":"https://api.github.com/users/dlabrecq/repos","events_url":"https://api.github.com/users/dlabrecq/events{/privacy}","received_events_url":"https://api.github.com/users/dlabrecq/received_events","type":"User","site_admin":false},"labels":[{"id":632272546,"node_id":"MDU6TGFiZWw2MzIyNzI1NDY=","url":"https://api.github.com/repos/openshiftio/openshift.io/labels/area/UI","name":"area/UI","color":"fef2c0","default":false},{"id":637470538,"node_id":"MDU6TGFiZWw2Mzc0NzA1Mzg=","url":"https://api.github.com/repos/openshiftio/openshift.io/labels/team/platform","name":"team/platform","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T18:02:08Z","updated_at":"2018-06-13T15:02:50Z","closed_at":null,"author_association":"COLLABORATOR","body":"After resetting my environment, the home dashboard widgets appear to be stuck in the loading state. I expect that the following subscription returns empty spaces so the loading state can be changed. However, debugging shows the code does not always reach here. \r\n\r\n```\r\nthis.subscriptions.push(spacesService.recent.subscribe(spaces => {\r\n      this.recentSpaces = spaces;\r\n      this.fetchRecentSpace();\r\n      this.loading = false;\r\n    }));\r\n```\r\n\r\nNote that after creating a new space, the code behaves as expected. After briefly loading, the widgets show the empty state as expected.\r\n\r\nNote that a timeout will also correct the problem.\r\n\r\n```\r\n    setTimeout(() => {\r\n      this.loading = false; // Failed to load\r\n    }, 2500);\r\n```\r\n\r\nScreenshot 1: Widgets continuously show the loading state after resetting environment\r\n![screen shot 2018-05-31 at 1 59 45 pm](https://user-images.githubusercontent.com/17481322/40799193-eb0c5f20-64da-11e8-9ab5-e57a53f65f2e.png)\r\n\r\nScreenshot 2: After creating a space -- showing empty state\r\n![screen shot 2018-05-31 at 2 04 42 pm](https://user-images.githubusercontent.com/17481322/40799471-ae62c6f8-64db-11e8-84a2-40ecb514043f.png)\r\n"},"comment":{"url":"https://api.github.com/repos/openshiftio/openshift.io/issues/comments/396970253","html_url":"https://github.com/openshiftio/openshift.io/issues/3705#issuecomment-396970253","issue_url":"https://api.github.com/repos/openshiftio/openshift.io/issues/3705","id":396970253,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Njk3MDI1Mw==","user":{"login":"jiekang","id":5430520,"node_id":"MDQ6VXNlcjU0MzA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/5430520?v=4","gravatar_id":"","url":"https://api.github.com/users/jiekang","html_url":"https://github.com/jiekang","followers_url":"https://api.github.com/users/jiekang/followers","following_url":"https://api.github.com/users/jiekang/following{/other_user}","gists_url":"https://api.github.com/users/jiekang/gists{/gist_id}","starred_url":"https://api.github.com/users/jiekang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiekang/subscriptions","organizations_url":"https://api.github.com/users/jiekang/orgs","repos_url":"https://api.github.com/users/jiekang/repos","events_url":"https://api.github.com/users/jiekang/events{/privacy}","received_events_url":"https://api.github.com/users/jiekang/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T15:02:50Z","updated_at":"2018-06-13T15:02:50Z","author_association":"COLLABORATOR","body":"Possible rework:\r\n\r\nThe widgets should have a default empty state. The loading state should be enabled when an http request to acquire data is made (after the spaces are acquired), and disabled when it returns, possibly after some time out.0\r\n\r\nIf there are no spaces then no http request will be made and the loading state need not trigger."}}
{"actor":{"display_login":"jiekang"}}