Public World APIs for System metadata
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
When using bevy primarily with`run_system_cached`/`run_system_cached_with` (such as server-side turn-based state) you don't have the same level of quality for error reporting as you do in usual Bevy apps as you have access to the SystemId but nothing else – no name for systems that fail to run, so no idea for where to start debugging from.
## What solution would you like?
Some way of accessing system metadata, potentially in a read-only way, using a `World` and a `SystemId` from "the outside" of the bevy internals.
## What alternative(s) have you considered?
Add a "system metadata" field to `RegisteredSystemError`'s variants, as the only reason I want this information is for error reporting.
## Additional context
I'm replacing a "one big state struct" game state with Bevy's ECS, in a context where the ECS is not running continuously but only running based on a given input when there's new events sent to the server. Previous architecture was Client request => Server APIs => call a method on the Big Struct to consume the input from the response, and my current architecture is more or less the same, but with a `World` instead of a Big Struct.
This means I have a number of exclusive systems I run with `run_system_cached` which also might call a bunch of exclusive systems, so there's not a clear understanding of where my errors are propagating from without a function name to match them to.
Contributor guide
Research direction
Start by tracing the public run_system_cached and run_system_cached_with entry points, then inspect RegisteredSystemError and how SystemId values are stored in World. Define what read-only metadata can be exposed outside Bevy internals and how it should support error reporting; the issue is done when the public API and its expected behavior are specified and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100