Skip to content

Commit

Permalink
Merge pull request #1939 from tursodatabase/fix-empty-sync
Browse files Browse the repository at this point in the history
libsql: Fix sync panic when remote database is empty
  • Loading branch information
penberg authored Jan 30, 2025
2 parents 016bea4 + 98a36fd commit 8b3c9a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libsql/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ impl SyncContext {
.map_err(SyncError::HttpBody)?;
return Ok(PullResult::Frame(frame));
}
if res.status() == StatusCode::BAD_REQUEST {
// BUG ALERT: The server returns a 500 error if the remote database is empty.
// This is a bug and should be fixed.
if res.status() == StatusCode::BAD_REQUEST || res.status() == StatusCode::INTERNAL_SERVER_ERROR {
let res_body = hyper::body::to_bytes(res.into_body())
.await
.map_err(SyncError::HttpBody)?;
Expand Down

0 comments on commit 8b3c9a7

Please sign in to comment.