Skip to content

fix(app): guard comment accessor in message timeline#17126

Merged
Hona merged 1 commit intoanomalyco:devfrom
Hona:fix/message-timeline-comment-crash
Mar 12, 2026
Merged

fix(app): guard comment accessor in message timeline#17126
Hona merged 1 commit intoanomalyco:devfrom
Hona:fix/message-timeline-comment-crash

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Mar 12, 2026

Summary

  • Guard comment() accessor with <Show> in the message timeline comment bubbles to prevent TypeError: Cannot read properties of undefined (reading 'path').

Root cause

The <Index each={comments()}> accessor can briefly return undefined during SolidJS reactive batch updates when the underlying sync.data.part[messageID] store changes. The createMemo(() => commentAccessor()) captures this undefined, and comment().path throws.

Stack trace

TypeError: Cannot read properties of undefined (reading 'path')
    at Object.fn (main-*.js)
    at runComputation (styles-*.js)
    at updateComputation
    at runTop
    at completeUpdates
    at runUpdates

During reactive store updates, the <Index> comment accessor can briefly
return undefined before cleanup. Wrap with <Show when={comment()}> to
prevent TypeError on .path access.
@Hona Hona requested a review from adamdotdevin as a code owner March 12, 2026 03:45
Copilot AI review requested due to automatic review settings March 12, 2026 03:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents a runtime crash in the session message timeline by guarding access to a comment object that can temporarily be undefined during SolidJS reactive updates.

Changes:

  • Wrap each comment bubble’s rendering in <Show when={comment()}> to avoid reading properties from an undefined comment.
  • Update comment bubble internals to reference the <Show>-provided accessor (c()) rather than the unguarded memo value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona merged commit db7bafe into anomalyco:dev Mar 12, 2026
14 of 15 checks passed
demostanis pushed a commit to demostanis/opencode that referenced this pull request Mar 19, 2026
demostanis pushed a commit to demostanis/opencode that referenced this pull request Mar 20, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Mar 24, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
RobertWsp pushed a commit to RobertWsp/opencode that referenced this pull request Apr 16, 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.

2 participants