-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factor out "defer" usage for better error handling #10178
Comments
@lilleyse @ptrgags Is there a particular reason why the loaders, like |
Some of the loaders like |
Ah thanks. Looking at these loaders, two things jump out at me:
|
Separate promises + a new state could be ok. Would this move some of the burden to the caller to load and then process the loader?
|
I'm not entirely sure yet, but I don't think so. So far it seems it can be handled internally and we just need to move around where the caller is actually handling the promises. I agree |
Ok that doesn't sound too bad. I was imagining that a larger restructuring would be needed.
We're aiming to remove it in June. Holding off until |
FYI, we ran into issues in unit testing a Cesium-based app related to this behavior and had to insert What's weird here is the model is never actually added to the scene, and my current understanding of how this works means that the promise should never reject or resolve. Ultimately, I think there is more going on here than we realize. For example, @lilleyse I don't know anything about the
Does that mean the July 1st release, or the June 1st release? It's only April 10th and I think we've introduced or magnifies several promise-related issues in CesiumJS with the last release. Just waiting around and hoping ModelExperimental fixes them seems like a bad call. |
The new implementation should be handling destroy + async operations more gracefully. All the loaders follow the pattern of checking
It would be the July 1st release. Since this is starting to impact development we should fix |
@sanjeetsuhag What's left here after #10523 and #10496? Is it only to refactor |
@ggetz 3 areas remain:
|
Cesium uses
defer
throughout the codebase as a remnant from when we were usingwhen.js
. However, the recommended best practice is to usenew Promise
constructor directly because it makes it much harder to let an exception escape. Functions passed to the construct should only reject the promise, never throw.#10149 excluded several specs in
Cesium3DTilesetSpec
,GltfLoaderSpec
,TimeDynamicPointCloudSpec
, andModelExperimentalSpec
which can be re-enabled once errors are better handled as a result of this change.The text was updated successfully, but these errors were encountered: