tuzig / peerbook

peerbook is A WebRTC signaling server with per-user address book
GNU Affero General Public License v3.0
3 stars 4 forks source link

Full webrtc support #41

Closed daonb closed 11 months ago

daonb commented 11 months ago

webexec is till supported for backward compatability

Summary by CodeRabbit

coderabbitai[bot] commented 11 months ago
### Walkthrough
The changes across the codebase focus on enhancing WebRTC connection management, improving error handling, and refining the interaction with a Redis database. Functions have been updated to better manage peer connections and states, with additional synchronization for thread safety. The removal of certain blocks of code suggests a simplification of logic, particularly around peer verification and message handling. Overall, the updates aim to streamline operations and improve the robustness of the system.

### Changes

| Files | Change Summary |
| --- | --- |
| `conn.go`, `connections.go` | Enhanced WebRTC connection management, added synchronization, improved error handling, and updated Redis key usage. |
| `db.go`, `db_test.go` | Simplified peer verification logic, removed unused code, and refocused tests on peer data retrieval. |
| `main.go`, `main_test.go` | Updated configurations, added new endpoints, and improved test logic and JSON handling. |
| `peer.go` | Updated comments and peer representation in the database. |
| `users.go`, `users_test.go` | Changed function signatures and error handling, added new functions, and updated tests with additional imports and logic. |

### Poem

> As winter whispers, the code hops along, 🐇❄️  
> Refactoring flows, making the system strong.  
> With each key and lock, and function refined,  
> The rabbit's work leaves no bug behind. 🌟

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`