Adam/rep 38 / rewrite server as elixir phoenix app#34
Merged
Conversation
Server code will be reimplemented in Elixir. The Rust client remains unchanged except for removing server dependency.
Validates phoenix_channels_client library works with Elixir/Phoenix server: - WebSocket connection and channel join with HMAC auth payload - Document CRUD operations via channel.call() - Full sync and incremental sync (get_changes_since) - Clean leave/disconnect lifecycle All tests pass - ready for Phase 6b websocket rewrite.
Replace tokio-tungstenite with phoenix_channels_client for Phoenix Channel protocol support. - Uses channel.events() for broadcast handling - Uses channel.call() for request-response operations - HMAC auth via channel join payload - Maintains ClientMessage/ServerMessage API compatibility Removed sync_engine_tests.rs (was specific to old WebSocket impl). Fixed fts_tests.rs API calls.
Port integration tests from original Rust server to test against Phoenix: - basic_sync_test.rs: connect, CRUD, full sync, changes since - multi_client_test.rs: broadcasts, bidirectional sync, 3-client CRUD - conflict_test.rs: hash mismatch, duplicate IDs, concurrent updates Uses serial_test crate to ensure sequential execution and avoid overwhelming the Phoenix server with concurrent WebSocket connections. Run with: RUN_INTEGRATION_TESTS=1 cargo test --test integration
- Default server URL now points to Phoenix (port 4000) - API credentials read from REPLICANT_API_KEY/SECRET env vars - Added 'env' feature to clap for env var support
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the synchronization server from Rust to Elixir Phoenix, marking a significant architectural change. The Rust-based replicant-server crate is completely removed, and the library interface is updated to reflect that the server is now implemented externally in Phoenix.
- Purpose: Replace the Rust-based WebSocket server implementation with an Elixir Phoenix application
- Key architectural shift: Server logic moves from Rust to Elixir, while the Rust client remains unchanged
- Migration scope: Complete removal of server implementation, tests, and infrastructure
Reviewed changes
Copilot reviewed 55 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| replicant/src/lib.rs | Removes server type re-export, adds comment pointing to Phoenix implementation location |
| replicant/Cargo.toml | Removes replicant-server dependency |
| Cargo.toml | Removes replicant-server from workspace members |
| replicant-client/tests/integration.rs | Adds new integration test module for Phoenix server communication |
| replicant-server/* | Complete removal of Rust server implementation (source, tests, migrations, configs) |
Files not reviewed (36)
- .sqlx/query-00c6850917dcade2bc114081644a36d3850b279bd8f769743d0eed649debe781.json: Language not supported
- .sqlx/query-149f797365bf674f3e1db9244953e4035c4ad4cb8a1d68f3c5e8f20f73776915.json: Language not supported
- .sqlx/query-2313576bc203b4556e28e1b997545bad39aa9e918a63fd57c180c597489ee06e.json: Language not supported
- .sqlx/query-2a39f4f1a59326de9001962e8607ced948e7835e88fedfb293a8aaaffa0d20ee.json: Language not supported
- .sqlx/query-2ed73705b549a66159dd2c31708a31a934844db08e2c13c8834d7b929bb6320c.json: Language not supported
- .sqlx/query-372dc8479e2801b60cded7728b036cb5b3169ab4a0430f0356c6a4ad85b3e81d.json: Language not supported
- .sqlx/query-4560c237741ce9d4166aecd669770b3360a3ac71e649b293efb88d92c3254068.json: Language not supported
- .sqlx/query-4789e3cf90a0df1485c68d1f82fb51697dc65a9a4166691e88403e0cc8f95991.json: Language not supported
- .sqlx/query-6a15a15b500a79c4f8bd51bd8e02d601d8c18b011dc1836bdaa0e7263a9749aa.json: Language not supported
- .sqlx/query-6f27bc53b8640f68a641e9f986b19c68ce770fa42bcb1ad7481311825d4b84a0.json: Language not supported
- .sqlx/query-7d901d90059386d8f1ba356f9452fc0bb784b3c79d4770d03e33b1e74b8b9aac.json: Language not supported
- .sqlx/query-87108e7d8e1a78704b7c8700e66ab50e54a36de687db4260fa4c4380834192e4.json: Language not supported
- .sqlx/query-b1693fd47cd64fc824577b9cda6d5c6f42e4f83457693157474706ab447c31a9.json: Language not supported
- .sqlx/query-c4434a4f91c6bf0c3004a9c30a28b5e862accee1c689dd9bc0d653f1672c8ff5.json: Language not supported
- .sqlx/query-c4d26a6822cd60d35a66a47d8acc25359c0f4931957cc60876d245405f30aa3a.json: Language not supported
- .sqlx/query-df81a8a6dfec1f0fc695afd590d1d7090f1657c572d23467d8f6a4dc9e757f12.json: Language not supported
- .sqlx/query-eeeaea03203fee5a7cab1798c13b97fe83efcd13313b323379ca5ae844df334e.json: Language not supported
- .sqlx/query-fa8e6a6f02a3c7d166904a4c3d64f0e6ffe3e152766398ad89c4f4e1fbac275f.json: Language not supported
- replicant-server/.sqlx/query-00c6850917dcade2bc114081644a36d3850b279bd8f769743d0eed649debe781.json: Language not supported
- replicant-server/.sqlx/query-149f797365bf674f3e1db9244953e4035c4ad4cb8a1d68f3c5e8f20f73776915.json: Language not supported
- replicant-server/.sqlx/query-2313576bc203b4556e28e1b997545bad39aa9e918a63fd57c180c597489ee06e.json: Language not supported
- replicant-server/.sqlx/query-2a39f4f1a59326de9001962e8607ced948e7835e88fedfb293a8aaaffa0d20ee.json: Language not supported
- replicant-server/.sqlx/query-2ed73705b549a66159dd2c31708a31a934844db08e2c13c8834d7b929bb6320c.json: Language not supported
- replicant-server/.sqlx/query-372dc8479e2801b60cded7728b036cb5b3169ab4a0430f0356c6a4ad85b3e81d.json: Language not supported
- replicant-server/.sqlx/query-4560c237741ce9d4166aecd669770b3360a3ac71e649b293efb88d92c3254068.json: Language not supported
- replicant-server/.sqlx/query-4789e3cf90a0df1485c68d1f82fb51697dc65a9a4166691e88403e0cc8f95991.json: Language not supported
- replicant-server/.sqlx/query-6a15a15b500a79c4f8bd51bd8e02d601d8c18b011dc1836bdaa0e7263a9749aa.json: Language not supported
- replicant-server/.sqlx/query-6f27bc53b8640f68a641e9f986b19c68ce770fa42bcb1ad7481311825d4b84a0.json: Language not supported
- replicant-server/.sqlx/query-7d901d90059386d8f1ba356f9452fc0bb784b3c79d4770d03e33b1e74b8b9aac.json: Language not supported
- replicant-server/.sqlx/query-87108e7d8e1a78704b7c8700e66ab50e54a36de687db4260fa4c4380834192e4.json: Language not supported
- replicant-server/.sqlx/query-b1693fd47cd64fc824577b9cda6d5c6f42e4f83457693157474706ab447c31a9.json: Language not supported
- replicant-server/.sqlx/query-c4434a4f91c6bf0c3004a9c30a28b5e862accee1c689dd9bc0d653f1672c8ff5.json: Language not supported
- replicant-server/.sqlx/query-c4d26a6822cd60d35a66a47d8acc25359c0f4931957cc60876d245405f30aa3a.json: Language not supported
- replicant-server/.sqlx/query-df81a8a6dfec1f0fc695afd590d1d7090f1657c572d23467d8f6a4dc9e757f12.json: Language not supported
- replicant-server/.sqlx/query-eeeaea03203fee5a7cab1798c13b97fe83efcd13313b323379ca5ae844df334e.json: Language not supported
- replicant-server/.sqlx/query-fa8e6a6f02a3c7d166904a4c3d64f0e6ffe3e152766398ad89c4f4e1fbac275f.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.