editor action unit suite crashes when RuntimeCreateSpec lacks environment
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- testing
Research direction
Start with tests/editor-actions.test.ts around line 288, then inspect resolveEditorOpenTarget in packages/runtime-playground/src/editor-actions.ts and secretEnvPhp in packages/runtime-playground/src/php-bootstrap.ts. Run npm run test:editor-actions to reproduce the crash. Done means the suite completes successfully with a valid handling path for a RuntimeCreateSpec without environment.
Written by the indexing model from the issue text.
Description
Problem
npm run test:editor-actions currently crashes before completing because a test fixture passes a RuntimeCreateSpec without environment, while secretEnvPhp() dereferences spec.environment.databaseSetup unconditionally.
Failure
TypeError: Cannot read properties of undefined (reading 'databaseSetup')
at secretEnvPhp (.../packages/runtime-playground/src/php-bootstrap.ts:280:24)
at bootstrapPhpCode (.../packages/runtime-playground/src/php-bootstrap.ts:41:3)
at resolveEditorOpenTarget (.../packages/runtime-playground/src/editor-actions.ts:140:11)
at .../tests/editor-actions.test.ts:288:24
Expected
The test fixture should supply a valid runtime environment, or the bootstrap contract should reject/normalize the incomplete spec before dereferencing it. The editor action suite should run to completion on current main.
Discovered while validating the post-merge security hardening for #2094; the affected bootstrap and test fixture are outside that PR's changes.
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 4
- Avg merge
- 53m
- Merged PRs (30d)
- 114
Contributor guide
No contributing guide indexed for this repository
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.
More from Automattic/wp-codebox
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Automattic/wp-codebox#2467 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Automattic/wp-codebox#2466 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Automattic/wp-codebox#2061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Automattic/wp-codebox#1714 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Automattic/wp-codebox#2506 ·
All issues in Automattic/wp-codebox
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·