Refactor PusherOptions to improve URI construction and logging format - #6
Merged
AbdoPrDZ merged 1 commit intoOct 24, 2025
Merged
Conversation
Contributor
Author
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the PusherOptions class to improve URI construction reliability and code formatting. The changes ensure that hostUri is always properly initialized even when host parsing fails, and simplify the URI building logic by removing complex null-checking patterns in favor of cleaner property checks.
Key Changes:
- Added fallback URI construction in the catch block to guarantee
hostUriis never null - Replaced null-safe operators and ternary expressions with direct property access using
hasPortandhasQuery - Improved code formatting with consistent multi-line syntax and trailing commas
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Owner
|
Hey! Really appreciate your help! |
Owner
blackwolf3342
force-pushed
the
blackwolf3342/fix-options-loop
branch
from
October 24, 2025 13:56
f4167a0 to
fd8fd1e
Compare
Contributor
Author
|
@AbdoPrDZ updated PR |
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.
Copying @padit69 PR #4 to be able release that.
This PR refactors the
PusherOptionsclass in/lib/src/options.dartwith the following improvements:URI Construction Changes
hostUriin the catch block when host parsing failshostUriis always initialized before use, eliminating complex null-checking ternary operatorsuri.portwithhostUri.portand changed port check fromport == 0to using thehasPortproperty for better semanticshostUri?.query.isNotEmpty == trueto the cleanerhostUri.hasQueryproperty