feat: identify routing-cycle errors by code and pointer - #373
Merged
Merged
Conversation
The error thrown when a dispatch exceeds 1,000 synchronous effect
batches carried only a message, so hosts had to match its text to tell
an immediate routing cycle apart from other failures.
It now also has code "routing_cycle" and pointer { sectionId, lineId }
for the line where the limit was reached. The message is unchanged.
Adds a Section Transition self-loop case to the bounded routing tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The error thrown when a dispatch exceeds 1,000 synchronous effect batches now carries
code: "routing_cycle"andpointer: { sectionId, lineId }for the line where the limit was reached. The message is unchanged.Why
Hosts need to tell an immediate routing cycle apart from other engine failures. Until now the only way was matching the message text. RouteVN Creator does that today (RouteVN/routevn-creator-client#1224) to show a specific "transitions keep repeating" alert in Preview. With a code it can check
error.code, and with the pointer it can name the scene and section in that alert.Changes
src/RouteEngine.js: setscodeandpointeron the limit error.docs/RouteEngine.md: documents both fields and says to identify the error bycode.spec/integration/projectRobustness.integration.test.js: the bounded routing tests assertcodeandpointerfor the initialization loop and the Auto-tick loop. Adds a Section Transition self-loop case, which is how authors usually hit this in the creator.Verified
bun run lint,bun run check:test-markers, Prettier on the changed files, andbun run test(90 files, 2,163 tests) pass. VT was not run; no rendering path changed.Version
Bumps
package.jsonto 1.46.5, in the same separate-commit style as earlier releases.