Skip to content

Cesium3DTileset loads tileset recursively on empty content URL #7263

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

Closed
vaclavblazek opened this issue Nov 14, 2018 · 3 comments · Fixed by #10462
Closed

Cesium3DTileset loads tileset recursively on empty content URL #7263

vaclavblazek opened this issue Nov 14, 2018 · 3 comments · Fixed by #10462
Labels
category - 3d tiles good first issue An opportunity for first time contributors type - enhancement

Comments

@vaclavblazek
Copy link

While writing 3D Tiles generator I've found out that an empty URL in the Tile's content (i.e. "content": { "url": "" }) causes cycle in the tile tree structure in the Cesuim API.

The core cause is because content's full URL is then the original tileset's URL and fetched JSON is treated as an external tileset. If there is more than one tile with an empty URL it is an equivalent of a fork bomb: the browser slows down terribly, endlessly loading external tilesets and actual tile data over and over again.

Propper handling should be to report invalid tile and maybe skip it.

@OmarShehata
Copy link
Contributor

Thanks for reporting this @vaclavblazek . I do agree it sounds like it would be a good idea to have a check on load to prevent this from happening.

I think it would be great to see a community contribution for this! I marked it good first issue since it could be a nice entry to how 3D Tiles are loaded in CesiumJS.

@j9liu
Copy link
Contributor

j9liu commented Jul 19, 2021

@ebogo1 or @lilleyse - I'm working on this issue right now and just wanted to clarify some things before I started implementing a solution.

  • If a Cesium3DTile is invalid (i.e. it contains "content": { "url": "" }), should it throw an error and stop the rest of the process?
  • If not, then I'll make it print something to the console. Should it then be skipped over while the other Cesium3DTiles load? Or should it be treated as a valid empty tile?

@lilleyse
Copy link
Contributor

Technically the tileset.json is invalid because it creates a circular dependency which is disallowed by the spec:

When a tile points to an external tileset, the tile:

  • Cannot be used to create cycles, for example, by pointing to the same tileset file containing the tile or by pointing to another tileset file that then points back to the initial file containing the tile.

https://github.com/CesiumGS/3d-tiles/tree/main/specification#external-tilesets

Generally we try not to add workarounds for invalid data but in this case I think it's fine to print a warning to the console and treat it like a regular empty tile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category - 3d tiles good first issue An opportunity for first time contributors type - enhancement
Projects
No open projects
Status: Issue/PR closed
5 participants