Skip to content

Commit 98a36fd

Browse files
committed
libsql: Fix sync panic when remote database is empty
Fixes #1938
1 parent 016bea4 commit 98a36fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libsql/src/sync.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ impl SyncContext {
281281
.map_err(SyncError::HttpBody)?;
282282
return Ok(PullResult::Frame(frame));
283283
}
284-
if res.status() == StatusCode::BAD_REQUEST {
284+
// BUG ALERT: The server returns a 500 error if the remote database is empty.
285+
// This is a bug and should be fixed.
286+
if res.status() == StatusCode::BAD_REQUEST || res.status() == StatusCode::INTERNAL_SERVER_ERROR {
285287
let res_body = hyper::body::to_bytes(res.into_body())
286288
.await
287289
.map_err(SyncError::HttpBody)?;

0 commit comments

Comments
 (0)