Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove query parameter from embedded replica url #1853

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

haaawk
Copy link
Contributor

@haaawk haaawk commented Nov 28, 2024

Otherwise replica fails with:

Error syncing database: sync error: failed to push frame: status=400 Bad Request, error={"error":"Protocol error: route not found: [\"?offline\", \"sync\", \"1\", \"1\", \"2\"]"}]

@haaawk haaawk requested a review from LucioFranco November 28, 2024 16:36
@haaawk
Copy link
Contributor Author

haaawk commented Nov 28, 2024

It turns out offline sync works with url like libsql://testd-haaawk.turso.io but it does not work with a trailing slash like libsql://testd-haaawk.turso.io/:

╰──> export LIBSQL_SYNC_URL=libsql://testd-haaawk.turso.io/ 
╰──> cargo run --example offline_writes                    
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.60s
     Running `target/debug/examples/offline_writes`
Please write your entry to the guestbook:
test6
You entered: test6

Guest book entries:
  test

  tent

  test2

  test3

  test4

  test5

  test6

Syncing database to remote...
thread 'main' panicked at libsql/examples/offline_writes.rs:77:21:
called `Result::unwrap()` on an `Err` value: Sync(PushFrame(404, "{\"error\":\"route not found: [\\\"\\\", \\\"sync\\\", \\\"1\\\", \\\"9\\\", \\\"10\\\"]\"}"))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I will have to make sure there's no trailing / in the url

@haaawk haaawk force-pushed the remove_offline_query_param branch from 09c793c to 7749b38 Compare November 28, 2024 19:55
@haaawk haaawk enabled auto-merge November 28, 2024 19:56
@haaawk haaawk added this pull request to the merge queue Nov 28, 2024
Merged via the queue into main with commit ff06574 Nov 28, 2024
18 checks passed
@haaawk haaawk deleted the remove_offline_query_param branch November 28, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants