{"action":"opened","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6208","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6208/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6208/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6208/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/6208","id":296399536,"number":6208,"title":"Resource clones can't be used at the same time","user":{"login":"thw0rted","id":943160,"avatar_url":"https://avatars3.githubusercontent.com/u/943160?v=4","gravatar_id":"","url":"https://api.github.com/users/thw0rted","html_url":"https://github.com/thw0rted","followers_url":"https://api.github.com/users/thw0rted/followers","following_url":"https://api.github.com/users/thw0rted/following{/other_user}","gists_url":"https://api.github.com/users/thw0rted/gists{/gist_id}","starred_url":"https://api.github.com/users/thw0rted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thw0rted/subscriptions","organizations_url":"https://api.github.com/users/thw0rted/orgs","repos_url":"https://api.github.com/users/thw0rted/repos","events_url":"https://api.github.com/users/thw0rted/events{/privacy}","received_events_url":"https://api.github.com/users/thw0rted/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-12T14:45:45Z","updated_at":"2018-02-12T14:45:45Z","closed_at":null,"author_association":"NONE","body":"Read [this comment](https://github.com/AnalyticalGraphicsInc/cesium/blob/1.42/Source/Core/Resource.js#L554) then consider this code:\r\n\r\n    const serviceBase = new Resource(\"/path/to/your/service\");\r\n    const serviceTypes = [\"a\", \"b\", \"c\", \"d\"];\r\n    serviceTypes.forEach(t => {\r\n      const endpoint = serviceBase.clone();\r\n      const fd = new FormData({serviceType: t});\r\n      endpoint.post(fd).then(\r\n        resp => console.log(t + \" responded.\", resp),\r\n        err => console.log(t + \" failed.\", err);\r\n      );\r\n    });\r\n\r\nCurrently, this will spew a bunch of errors on the console, \"resource is already being fetched\".  It violates the expectation that in\r\n\r\n   const r1 = new Resource(\"/path\");\r\n   const r2 = new Resource(\"/path\");\r\n   const r3 = r1.clone();\r\n\r\nall three resources could be used interchangeably.  This is not true, because r1 and r2 can run at the same time, but r1 and r3 cannot.\r\n\r\nI'm not totally clear on what the comment means about \"breaking the request scheduler\", so I'm sure there are implications to consider, but on the face of it, I think `clone()` needs to always make a new Request.  If it isn't going to make a new one, the docs need to carefully explain the implications of `clone()`, and describe how a clone is different from a first-class Resource.\r\n\r\nIn the short term, `getDerivedResource({})` (note the empty object as sole argument) is basically a drop-in replacement for how I expected `clone()` to work.\r\n"}}
{"actor":{"display_login":"thw0rted"}}