Skip to content

Add wspath option - #3

Open
AbdoPrDZ wants to merge 6 commits into
AbdoPrDZ:mainfrom
rivens:add_wspath_option
Open

Add wspath option#3
AbdoPrDZ wants to merge 6 commits into
AbdoPrDZ:mainfrom
rivens:add_wspath_option

Conversation

@AbdoPrDZ

Copy link
Copy Markdown
Owner

No description provided.

@AbdoPrDZ
AbdoPrDZ requested a review from Copilot June 12, 2025 20:26

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a new wsPath option for custom WebSocket path configuration, updates usage docs, and bumps the package version.

  • Bumps version from 0.0.5 to 0.0.6
  • Adds wsPath field with default /app and uses it in URL path construction
  • Updates README with wsPath in example and options table, fixes a typo

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pubspec.yaml Bump version to 0.0.6
lib/src/options.dart Add wsPath option, default value, and apply in path
README.md Include wsPath in example and options table; fix typo
Comments suppressed due to low confidence (2)

README.md:168

  • The README states the default for encrypted is false, but the code default is true. Please align the documentation with the implementation or adjust the default in code.
| `encrypted`               | `bool`                                                                              | A flag indicating whether to enable encrypted connection. Default is `false`.                                                                    |

lib/src/options.dart:26

  • Add unit tests for the new wsPath option to verify that WebSocket URLs are constructed correctly under different path values.
final String wsPath;

Comment thread lib/src/options.dart
if (hostUri?.query.isNotEmpty == true) ...hostUri!.queryParameters,
},
path: '/app/$key',
path: '${wsPath}/${key}',

Copilot AI Jun 12, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Consider normalizing wsPath (e.g., trimming a trailing slash) before concatenation to prevent duplicate or missing slashes in the final URL.

Suggested change
path: '${wsPath}/${key}',
path: '${wsPath.replaceAll(RegExp(r'/+$'), '')}/${key}',

Copilot uses AI. Check for mistakes.
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