forked from Furumi/furumi-web
Test episode resume positions and rollback cleanup on PostgreSQL
The ignored device-sync PostgreSQL test now also covers a handoff and a remote Next onto an episode with an unknown position (the relayed progress register supplies 1200 s and its generation), and checks that 0.12's operation types fail on a relayed podcast operation and read the log again after the documented cleanup statement, which the m_0055 backwards operation now shares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a04a7460e6
commit
c1cd689ea0
4 files changed
+159
-5
No files matched your search
+7
-3
@@ -2908,15 +2908,19 @@ pub mod db_migrations {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Removes the operations a 0.12.x release cannot parse: the podcast
|
||||
/// kinds relayed since device-sync protocol 4. Ends with its `WHERE`
|
||||
/// clause, so tests can narrow it to one user.
|
||||
pub(crate) const DELETE_PODCAST_SYNC_OPS_SQL: &str =
|
||||
"DELETE FROM furumusic__fed_sync_ops WHERE kind LIKE 'podcast\\_%'";
|
||||
|
||||
// Release 0.12.x parses every unacknowledged operation it sends to a
|
||||
// peer and fails the whole batch on an unknown kind, so the podcast
|
||||
// operations relayed by 0.13 must go before it runs again (see
|
||||
// docs/administration.md, "Rolling back to 0.12").
|
||||
#[cot::db::migrations::migration_op]
|
||||
async fn drop_fed_podcast_relay(ctx: migrations::MigrationContext<'_>) -> cot::db::Result<()> {
|
||||
ctx.db
|
||||
.raw("DELETE FROM furumusic__fed_sync_ops WHERE kind LIKE 'podcast\\_%'")
|
||||
.await?;
|
||||
ctx.db.raw(DELETE_PODCAST_SYNC_OPS_SQL).await?;
|
||||
ctx.db
|
||||
.raw("DROP TABLE IF EXISTS furumusic__fed_podcast_relay")
|
||||
.await?;
|
||||
|
||||
Reference in new issue
Block a user