coolify/app/Livewire/Project/Database
Andras Bacsai aa18c48823 fix: resolve uncloseable database restore modal on MariaDB import (#7335)
Fixes the "Snapshot missing on Livewire component" error that occurs when
toggling the "Backup includes all databases" checkbox during MariaDB database
import operations.

Root Cause:
- ActivityMonitor component was initialized without proper lifecycle hooks
- When parent Import component re-rendered (via checkbox toggle), the
  ActivityMonitor's Livewire snapshot became stale
- Missing null checks caused errors when querying with undefined activityId
- No state cleanup when slide-over closed, causing issues on subsequent opens

Changes:
- Add updatedActivityId() lifecycle hook to ActivityMonitor for proper hydration
- Add defensive null check in hydrateActivity() to prevent query errors
- Track activityId in Import component for state management
- Add slideOverClosed event dispatch in slide-over component
- Add event listener in Import component to reset activityId on close

Testing:
- Manually verify checkbox toggle doesn't trigger popup
- Verify actual restore operations work correctly
- Test both file-based and S3-based restore methods
- Ensure X button properly closes the modal
- Verify no console errors or Livewire warnings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 10:43:07 +01:00
..
Backup Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00
Clickhouse fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Dragonfly fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Keydb fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Mariadb fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Mongodb fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Mysql fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Postgresql fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
Redis fix: add authorization checks to database Livewire components 2025-10-14 17:33:42 +02:00
BackupEdit.php feat(DatabaseBackupJob, ScheduledTaskJob): enforce minimum timeout and add execution ID for timeout handling 2025-11-11 12:07:39 +01:00
BackupExecutions.php feat(backup): enhance backup job with S3 upload handling and notifications 2025-10-07 15:02:23 +02:00
BackupNow.php feat(auth): implement authorization checks for database management 2025-08-23 18:50:35 +02:00
Configuration.php Merge branch 'next' into andrasbacsai/livewire-model-binding 2025-10-16 11:05:29 +02:00
CreateScheduledBackup.php feat(auth): implement authorization checks for database management 2025-08-23 18:50:35 +02:00
Heading.php Fix loading icon showing during automatic status checks 2025-10-24 12:58:52 +02:00
Import.php fix: resolve uncloseable database restore modal on MariaDB import (#7335) 2025-11-26 10:43:07 +01:00
InitScript.php Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00
ScheduledBackups.php feat(auth): implement authorization checks for database management 2025-08-23 18:50:35 +02:00