Skip to content

Commit

Permalink
Merge pull request #2212 from scpwiki/file-fix
Browse files Browse the repository at this point in the history
Fix file revision move bugs
  • Loading branch information
Zokhoi authored Dec 15, 2024
2 parents bbd26ab + 20251dc commit 067be50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions deepwell/src/services/file_revision/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ impl FileRevisionService {
let txn = ctx.transaction();
let revision_number = next_revision_number(&previous, page_id, file_id);

// Replace with debug_assert_matches! when stablized
// Replace with debug_assert_matches! when stablized.
// This should correspond to each use of FileRevisionService::create() in FileService.
debug_assert!(
matches!(
revision_type,
FileRevisionType::Regular | FileRevisionType::Rollback,
FileRevisionType::Regular
| FileRevisionType::Move
| FileRevisionType::Rollback,
),
"Invalid revision type for standard revision creation",
);
Expand Down Expand Up @@ -541,7 +544,6 @@ impl FileRevisionService {
pub async fn get_range(
ctx: &ServiceContext<'_>,
GetFileRevisionRange {
page_id,
file_id,
revision_number,
revision_direction,
Expand Down Expand Up @@ -570,7 +572,6 @@ impl FileRevisionService {
let revisions = FileRevision::find()
.filter(
Condition::all()
.add(file_revision::Column::PageId.eq(page_id))
.add(file_revision::Column::FileId.eq(file_id))
.add(revision_condition),
)
Expand Down
1 change: 0 additions & 1 deletion deepwell/src/services/file_revision/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ pub struct UpdateFileRevision {

#[derive(Deserialize, Debug, Clone)]
pub struct GetFileRevisionRange {
pub page_id: i64,
pub file_id: i64,
pub revision_number: i32,
pub revision_direction: FetchDirection,
Expand Down

0 comments on commit 067be50

Please sign in to comment.