Skip to content

Commit

Permalink
fix: prevent reporting http errors in sync_offline
Browse files Browse the repository at this point in the history
resolves #1919
  • Loading branch information
levydsa committed Jan 17, 2025
1 parent 573ba92 commit eaccfee
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libsql/src/local/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,21 @@ impl Database {
} else {
self.try_pull(&mut sync_ctx, &conn).await
}
.or_else(|err| {
let Error::Sync(err) = err else {
return Err(err);
};

// Ideally, *err* wouldn't be type erased, we aren't doing dynamic typing.
let Some(SyncError::HttpDispatch(_)) = err.downcast_ref::<SyncError>() else {
return Err(Error::Sync(err));
};

Ok(crate::database::Replicated {
frame_no: None,
frames_synced: 0,
})
})
}

#[cfg(feature = "sync")]
Expand Down

0 comments on commit eaccfee

Please sign in to comment.