Repository navigation
fix(core): stop discarding the per-version promises in core() - #87
Merged
Merged
Conversation
core() built its data in an unawaited `.map(async ...)`, so everything after the `await determineCurrentReleasePhase(...)` ran as a later continuation and errors became unhandled rejections. determineCurrentReleasePhase is now sync and the loop is a plain for...of, so core() rejects on errors and returns fully built data.
# Conflicts: # core/index.js
bnb
approved these changes
Oct 20, 2026
Merged
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.
core() built its data inside
Object.keys(versions).map(async (version) => { ... })(L21) and never awaited the promises before returning. The callback awaiteddetermineCurrentReleasePhase(L129-L133), sosupport.lts.oldest, each release'sltsandsecurityobjects, andsecurity.newest/oldest/allall ran as later continuations. They only finished before callers sawdatabecausedetermineCurrentReleasePhaseisasyncwithout doing anything async. Errors thrown in the callback were swallowed too: core() resolved with partial data and the error became an unhandled rejection.Changed:
determineCurrentReleasePhaseis now sync, and the.map(async ...)is now afor...ofloop with the same body.Added:
core/test/errors.jschecks that core() rejects when index.json has a version it can't parse. On main this test fails.Output is unchanged: JSON from main and this branch is identical on the real index.json and schedule.json at five dates from 2016 to 2030. This conflicts with #86 on the first line of the loop. Resolve it by keeping the
forline from here and thecoercechange from #86.