{"action":"created","issue":{"url":"https://api.github.com/repos/theia-ide/theia/issues/1834","repository_url":"https://api.github.com/repos/theia-ide/theia","labels_url":"https://api.github.com/repos/theia-ide/theia/issues/1834/labels{/name}","comments_url":"https://api.github.com/repos/theia-ide/theia/issues/1834/comments","events_url":"https://api.github.com/repos/theia-ide/theia/issues/1834/events","html_url":"https://github.com/theia-ide/theia/issues/1834","id":319260044,"number":1834,"title":"Theia starts with the wrong workspace","user":{"login":"lmcbout","id":419051,"avatar_url":"https://avatars2.githubusercontent.com/u/419051?v=4","gravatar_id":"","url":"https://api.github.com/users/lmcbout","html_url":"https://github.com/lmcbout","followers_url":"https://api.github.com/users/lmcbout/followers","following_url":"https://api.github.com/users/lmcbout/following{/other_user}","gists_url":"https://api.github.com/users/lmcbout/gists{/gist_id}","starred_url":"https://api.github.com/users/lmcbout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmcbout/subscriptions","organizations_url":"https://api.github.com/users/lmcbout/orgs","repos_url":"https://api.github.com/users/lmcbout/repos","events_url":"https://api.github.com/users/lmcbout/events{/privacy}","received_events_url":"https://api.github.com/users/lmcbout/received_events","type":"User","site_admin":false},"labels":[{"id":547099391,"url":"https://api.github.com/repos/theia-ide/theia/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-01T17:09:06Z","updated_at":"2018-05-18T19:04:05Z","closed_at":null,"author_association":"COLLABORATOR","body":"User expected to have the specified workspace when initiating the browser.\r\n\r\nHow to reproduce:\r\n1- Web browser: already open in a workspace\r\n2- Create a new workspace: mkdir ~/zzworkspace + create some filesin it: baba, ppp, qqq, toto\r\n3- Start Theia application: yarn start ~/zzworkspace\r\n4- Note In the web browser, The current workspace will go from off-line to on line (The bottom status bar change color and state)\r\n5- Select the refresh workspace from the web browser\r\n  Note: Since the user initiated the application specifying a new workspace, as an end-user, I would expect that the \"localhost:3000\" would show me the new workspace when I refresh the browser (Not the case here)\r\nShow files in work1 (Files: aaa, bbb, ccc,ddd)\r\n\r\n6- Even If I modify the old workspace, it will refresh it if that workspace still exist !!!!\r\n7- Now close the web browser with the old workspace (just the workspace page) the browser has other pages available\r\n8- Open the web browser to localhost:3000\r\n  -> Re-open the old workspace instead of the workspace specified when I started Theia !!!\r\n\r\n9 Now close again the web browser \"localhost:3000\"\r\n10- Stop theia (server side)\r\n11- restart Theia with the same original workspace : yarn start ~/zzworkspace\r\n12- On the browser, start a new \"localhost:3000\"\r\n--> browser show the user-selected workspace now (As expected initially)\r\n(Files: baba, ppp, qqq, toto)\r\n\r\n![peek 2018-05-01 wrongworkspace](https://user-images.githubusercontent.com/419051/39483542-bc03c65c-4d40-11e8-907a-98f79073e739.gif)\r\n"},"comment":{"url":"https://api.github.com/repos/theia-ide/theia/issues/comments/390302922","html_url":"https://github.com/theia-ide/theia/issues/1834#issuecomment-390302922","issue_url":"https://api.github.com/repos/theia-ide/theia/issues/1834","id":390302922,"user":{"login":"marcdumais-work","id":25749063,"avatar_url":"https://avatars2.githubusercontent.com/u/25749063?v=4","gravatar_id":"","url":"https://api.github.com/users/marcdumais-work","html_url":"https://github.com/marcdumais-work","followers_url":"https://api.github.com/users/marcdumais-work/followers","following_url":"https://api.github.com/users/marcdumais-work/following{/other_user}","gists_url":"https://api.github.com/users/marcdumais-work/gists{/gist_id}","starred_url":"https://api.github.com/users/marcdumais-work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcdumais-work/subscriptions","organizations_url":"https://api.github.com/users/marcdumais-work/orgs","repos_url":"https://api.github.com/users/marcdumais-work/repos","events_url":"https://api.github.com/users/marcdumais-work/events{/privacy}","received_events_url":"https://api.github.com/users/marcdumais-work/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T19:04:05Z","updated_at":"2018-05-18T19:04:05Z","author_association":"COLLABORATOR","body":"I agree that it's sometimes hard to predict which workspace will be opened, when starting a Theia client. \r\n\r\nExperimenting with this a bit, I observed that there seems to be many factors, that affect the workspace, that ends-up being opened. In no particular order: \r\n - A) workspace provided at the command-line when starting the backend : ```yarn run start /path/to/some/ws```\r\n - B) \"latest\" workspace, saved in user's home directory (e.g. in ```~/.theia/recentworkspace.json``` on Linux), updated each time a client is closed/restarted.\r\n - C) workspace currently being used by a pre-existing client\r\n - D) workspace already being used by a given client, when restarting that same client, is re-set\r\n - E) workspace apparently \"remembered\" by the backend, that was recently used by a client that is now closed, even if ```~/.theia/recentworkspace.json``` is erased, if the backend was not restarted since\r\n - F) until recently we had an additional wildcard: a timing bug would sometimes have Theia open with no workspace, when it should have opened with one. Upon client reload, that situation would correct itself.  (see: https://github.com/theia-ide/theia/pull/1846)\r\n\r\nIn the absence of all these factors, Theia starts without a workspace. If we make sure to insulate a single one factor, the intuitive thing seems to happen. The question is, when a mix of those factors is present, which do we expect should \"win\"? This is not always obvious. \r\n\r\n> 1- Web browser: already open in a workspace\r\n[...]\r\n5- Select the refresh workspace from the web browser\r\nNote: Since the user initiated the application specifying a new workspace, as an end-user, I would expect that the \"localhost:3000\" would show me the new workspace when I refresh the browser (Not the case here)\r\n\r\nThis seems to assume that A should have priority over D? I think it should be the reverse, and that A should only provide a default, e.g. for the workspace server case, so that the user does not need to manually open a workspace that was already pre-populated for them by the workspace server, the first time that workspace is used. \r\n\r\nIf the reverse was true (if A had priority over D), we following could happen: \r\n- Start Theia Backend specifying a workspace\r\n- Start a few clients that connect to that backend\r\n- In each client select a different workspace, e.g. simulating working on different tasks / repos\r\n- Restart each client\r\n- They all restart on the workspace specified in the first step\r\n\r\n> 6- Even If I modify the old workspace, it will refresh it if that workspace still exist !!!!\r\n\r\nIt's not clear to me what this means? \r\n\r\n> 7- Now close the web browser with the old workspace (just the workspace page) the browser has other pages available\r\n8- Open the web browser to localhost:3000\r\n-> Re-open the old workspace instead of the workspace specified when I started Theia !!!\r\n\r\nThis might be because currently B has priority over A? This behavior seems ok to me. I guess I see A as a last-chance fallback, in case no worthy workspace can be found in any other way.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"marcdumais-work"}}