Skip to content

feat(livewire): capture component state from snapshot data#45

Merged
Naoray merged 1 commit intomainfrom
feat/livewire-component-state
Feb 8, 2026
Merged

feat(livewire): capture component state from snapshot data#45
Naoray merged 1 commit intomainfrom
feat/livewire-component-state

Conversation

@Naoray
Copy link
Copy Markdown
Owner

@Naoray Naoray commented Feb 8, 2026

Summary

  • Extracts component state (data key) from Livewire snapshot payloads in LivewireDataCollector::extractComponents()
  • Adds truncateState() method that caps state at 50 keys and 8KB serialized size to prevent excessive data capture
  • Sensitive values in state are automatically redacted by the existing redactPayload() call
  • Adds 7 new tests covering state extraction, truncation by key count, truncation by size, redaction of sensitive state values, and edge cases

Closes #36

Test plan

  • Existing 7 LivewireDataCollector tests still pass
  • New test: component state is captured from JSON-encoded snapshot
  • New test: component state is captured from array snapshot
  • New test: state key is absent when snapshot has no data
  • New test: state is truncated when exceeding 50 keys
  • New test: state is truncated when serialized size exceeds 8KB
  • New test: sensitive values (password) in state are redacted
  • Full test suite passes (285 tests, 877 assertions)

🤖 Generated with Claude Code

Closes #36

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Naoray Naoray force-pushed the feat/livewire-component-state branch from 372d210 to 8fa054c Compare February 8, 2026 13:10
@Naoray Naoray merged commit 51e1a5c into main Feb 8, 2026
11 checks passed
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.

Capture Livewire component state from snapshot data

1 participant