Skip to content

Adam/rep 38 / rewrite server as elixir phoenix app#34

Merged
adamski merged 11 commits intomainfrom
adam/rep-38-rewrite-server-as-elixirphoenix-app
Jan 6, 2026
Merged

Adam/rep 38 / rewrite server as elixir phoenix app#34
adamski merged 11 commits intomainfrom
adam/rep-38-rewrite-server-as-elixirphoenix-app

Conversation

@adamski
Copy link
Collaborator

@adamski adamski commented Jan 5, 2026

No description provided.

adamski added 11 commits January 5, 2026 13:21
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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@adamski adamski merged commit e980bfa into main Jan 6, 2026
10 checks passed
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.

2 participants