Skip to content

Conversation

@betsyecastro
Copy link
Contributor

After filing a student application and applying a filter, the students are not categorized correctly. See issue #154 for steps to reproduce.

Refreshing the students after updating the component fixes the issue (done in PR #179). However, after adding a new property to the component in PR #200, and updating it via wire directive triggers the update() lifecycle hook, resulting in a refreshStudents() call, which represents an unnecessary and slow request.

After investigating the original bug further, it was found that when the $students property is set to a static value in the refreshStudents() method, it is treated as a public property and no longer works as a computed property. When the component is re-hydrated, the application pivot relationship is not loaded.

See issues livewire/livewire#3487 and livewire/livewire#1272 (comment) Related to why public properties that are model instances are not serialized with the entire model (or pivot relationship) during the re-hydration process.
Livewire hydration documentation.

The proper fix is to reset the $students property using unset() in order to preserve the computed property behavior.

@betsyecastro betsyecastro requested a review from wunc December 15, 2025 17:24
@betsyecastro betsyecastro self-assigned this Dec 15, 2025
@betsyecastro betsyecastro added the 🐛 bug Something isn't working label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants