matrix-org / matrix-org/matrix-spec
"Spec" nightly workflow occasionally fails due to `TypeError: Cannot read properties of undefined (reading 'map')`
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
The nightly "Spec" workflow failed last night with the following traceback:
> matrix-spec@0.0.1 get-proposals
> node ./scripts/proposals.js
/home/runner/work/matrix-spec/matrix-spec/scripts/proposals.js:201
const labelsForIssue = issue.labels.map(l => l.name);
^
TypeError: Cannot read properties of undefined (reading 'map')
at /home/runner/work/matrix-spec/matrix-spec/scripts/proposals.js:201:41
at Array.filter (<anonymous>)
at processIssues (/home/runner/work/matrix-spec/matrix-spec/scripts/proposals.js:200:36)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.19.3
This is the script in question:
which is used to build the Spec Change Proposals page.
This appears to be only an occasional failure, one that has happened before. Re-running the script manually today yielded success.
From the traceback and the occasional success, my guess is that the GitHub API is occasionally returning the wrong thing. The only impact of this is the spec proposals page getting out of date by a day or two, so fairly low-priority.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in scripts/proposals.js at processIssues around lines 200-201, then inspect the nightly workflow in .github/workflows/main.yml and the linked failed run. Run the proposals script to observe the intermittent behavior. Done means the nightly workflow no longer fails when the API response lacks the expected labels and the proposals page can still be generated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, github-actions, javascript
- Domain
- ci-cd, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100