Skip to content

fix: handle null strategy context in manual generation - #50

Closed
CBOSSX wants to merge 1 commit into
darkzOGx:masterfrom
CBOSSX:bugfix/null-strategy-context-20260918T040252Z
Closed

CBOSSX wants to merge 1 commit into
darkzOGx:masterfrom
CBOSSX:bugfix/null-strategy-context-20260918T040252Z

Conversation

@CBOSSX

@CBOSSX CBOSSX commented Sep 18, 2026

Copy link
Copy Markdown

What & why

Manual dashboard video creation sends strategyContext: null. The existing destructuring default only handles undefined, so generation crashes while reading strategyContext.angle before reaching script writing. Normalize the optional context with ?? {} so manual generation uses the existing strategy/channel defaults, while supplied strategy context remains intact.

Closes #38.

Checklist

  • One focused concern per PR (split unrelated changes into separate PRs)
  • No package-lock.json regeneration unless the PR is specifically about dependencies
  • npm run lint passes
  • npm test passes (add a test if you fixed a bug)
  • Rebased on current master (tested base 260d7a94ab2d5bb2a98ce6620bfda7efd56ebd6b, still current immediately before publication)

How I tested it

  • Added SystemTest.testManualGenerationStrategyContext to the standard npm test runner. It exercises the real strategy stage with null, omitted and populated contexts, checks defaults and supplied context preservation, and stops at the script-writing boundary before any provider/media work.
  • On unchanged production code, the regression exits 1 with TypeError: Cannot read properties of null (reading 'angle'). With the fix, it exits 0 for all three cases.
  • npm test: 46 passed, 0 failed. The existing slideshow test verified browser-safe image embedding but skipped its live browser assertion because Chromium is not installed. No live provider/video generation was performed.
  • npm run lint and git diff --cached --check: passed.

Scope: two files, 40 additions and one deletion; no dependency or generated-file changes.

@CBOSSX

CBOSSX commented Sep 22, 2026

Copy link
Copy Markdown
Author

Closing as superseded by upstream commit 124a1ed, which normalizes null strategyContext and adds regression coverage. I checked current master (941c3be): generateContent now uses rawStrategyContext || {}, and the upstream test exercises strategyContext: null. Issue #38 is closed with the maintainer鈥檚 confirmation and CI link. This makes the fix in this PR redundant; no conflict-resolution commit is needed. Thank you for resolving it upstream.

@CBOSSX CBOSSX closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

strategyContext null causes "Cannot read properties of null (reading 'angle')" crash in generateContent

1 participant