fix(telos): crash guards for one-mission users in Life Dashboard#1154
Open
brycemagera wants to merge 1 commit intodanielmiessler:mainfrom
Open
fix(telos): crash guards for one-mission users in Life Dashboard#1154brycemagera wants to merge 1 commit intodanielmiessler:mainfrom
brycemagera wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
sections.tsx: missions[1] fallback → missions[0] + explicit null guard
horizon.tsx: missions[1] fallback → missions[0]
app.tsx: initial mission state "M1" → "M0"; useEffect to reset to
first available id when live data loads
Complements danielmiessler#1147 (data plumbing). Crash affects any user with < 2
missions: TypeError: Cannot read properties of undefined (reading 'horizon').
3f328db to
76d0ac5
Compare
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.
Problem
Any user with fewer than 2 missions defined gets an immediate
TypeErroron the Telos page:Three spots used
missions[1]as a fallback:sections.tsxline 89 — fallback mission for renderinghorizon.tsxline 15 — sameapp.tsx— initial mission state hardcoded to"M1"; when live data loads with onlyM0, no valid mission is selectedFix
sections.tsx+horizon.tsx:missions[1]→missions[0]+ explicit null guard so the component can return null cleanly if no missions exist at all.app.tsx: initial state"M1"→"M0"; addeduseEffectto reset to the first available mission ID when live data arrives with different IDs than the initial state assumed.How This Fits With the Other Telos PRs
Three open PRs each fix a different layer of the telos stack — all complementary, no conflicts:
GenerateTelosSummary.ts— regex, strategy bullets, goal section classifierobservability.tsparser robustness +use-telos-data.tsfetch wired to/api/telos/overviewsections.tsx,horizon.tsx,app.tsx— guards for < 2 missionsRecommended merge order: #1127 (standalone) → #1147 (data plumbing) → #1154 (crash guards surface once data flows).
Revision Note
Originally this PR also introduced a new
/telosendpoint inpulse.ts+modules/telos.ts. After reviewing #1147, that approach was dropped — #1147's use of the existing/api/telos/overviewendpoint is architecturally correct and avoids a parallel endpoint. This PR is now focused exclusively on crash prevention.