-
Notifications
You must be signed in to change notification settings - Fork 266
Open
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
When a channel is deleted and then restored, the channel published's state is not fully recovered
Current Behavior
-
When a channel is deleted:
- The channel
main_tree.publishedfield is set to false - Main content database (
{channel_id}.sqlite3) is removed
- The channel
-
When a channel is restored:
- The channel is restored just by setting its
deletedfield to false, but none of the publish stat is recovered (although theversionfield is still set).
- The channel is restored just by setting its
This creates inconsistencies because after a channel is deleted and then restored, its version field is set, but its main_tree.published is false.
Technical details
When restoring a deleted channel channel.version > 0, we should:
- Restore the
main_tree.publishedfield to true. - Restore the main content database in a background task:
- Copy the latest versioned database
{channel_id}_{version}.sqlite3to become the main database{channel_id}.sqlite3. Similarly to what we do on the ensure_versioned_database_exists, but in the other direction.
- Copy the latest versioned database
Acceptance Criteria
- When a deleted channel is restored, its
main_tree.publishedfield is automatically set to true - A background task is created to restore the main content database
🤖 This issue was written with AI assistance, under supervision, review, and final edits by @AlexVelezLl 🤖
Metadata
Metadata
Assignees
Labels
No labels
