Skip to content

fix(chat): prevent scrollHeight errors with null checks#29

Merged
rodrigogs merged 14 commits into
mainfrom
dev
Dec 26, 2025
Merged

fix(chat): prevent scrollHeight errors with null checks#29
rodrigogs merged 14 commits into
mainfrom
dev

Conversation

@rodrigogs
Copy link
Copy Markdown
Owner

Summary

Fixes runtime error: Cannot read properties of null (reading 'scrollHeight')

Bug Details

The error occurred when the chat container element was accessed after being unmounted or when it became null between an effect check and a callback execution.

Changes

  • Added null check inside requestAnimationFrame callback in scroll-to-bottom effect
  • Prevents crashes when component unmounts during scroll operations

Testing

  • Verified no TypeScript/Svelte errors
  • Prevents the scrollHeight null reference error

Type: Bug fix (patch release)

rodrigogs and others added 14 commits December 25, 2025 10:07
…zip-parser

feat: add iOS WhatsApp export format support with enhanced error handling
…ation, and improved document display

- Add video thumbnail extraction with hover scrubbing preview
- Display audio file duration on gallery thumbnails
- Add colored extension badges for document thumbnails (PDF, Word, Excel, etc.)
- Show file size for documents in gallery view
- Fix SVG thumbnail handling (use direct blob URL instead of canvas)
- Fix media linking by stripping invisible Unicode characters (U+200E LTR mark)
- Fix short filename matching issue (require 10+ chars for partial matching)
- Add cursor pointer on media thumbnail hover
- Center video play button overlay on thumbnails

New helper modules:
- src/lib/helpers/video-thumbnails.ts: Video frame extraction utilities
- src/lib/helpers/document-utils.ts: Document type colors and formatting
Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>
fix: address PR #26 code review comments - memory, accessibility, and performance improvements
…cking, and file size handling

Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>
Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>
…ame warnings

Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>
fix: improve video frame extraction, error handling, and file type detection robustness
…errors

- Add null check inside requestAnimationFrame callback in scroll-to-bottom effect
- Add null check in loadMoreMessages function guard
- Prevents 'Cannot read properties of null' errors when component unmounts
@rodrigogs rodrigogs merged commit afa848e into main Dec 26, 2025
7 checks passed
github-actions Bot pushed a commit that referenced this pull request Dec 26, 2025
## [1.20.1](v1.20.0...v1.20.1) (2025-12-26)

### Bug Fixes

* **chat:** prevent scrollHeight errors with null checks ([#29](#29)) ([afa848e](afa848e))
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.20.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.21.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants