-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(skymp5-client): make server settings more flexible #2347
feat(skymp5-client): make server settings more flexible #2347
Conversation
headers['X-Session'] = session; | ||
} | ||
|
||
const res = await masterApiClient.get(`/api/servers/${masterKey}/serverinfo`, { headers }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promises are not yet supported in main menu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 4d64152 in 2 minutes and 56 seconds
More details
- Looked at
415
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
13
drafted comments based on config settings.
1. skymp5-client/src/index.ts:54
- Draft comment:
New import for SettingsService added. Ensure it’s grouped with other service imports for consistency. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. skymp5-client/src/index.ts:66
- Draft comment:
Instantiating SettingsService as first listener. Confirm dependency order as other services may rely on settings. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
3. skymp5-client/src/services/services/authService.ts:53
- Draft comment:
Duplicate server settings functions have been removed in favor of SettingsService. Ensure all consumers now use SettingsService. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. skymp5-client/src/services/services/authService.ts:196
- Draft comment:
Using SettingsService for constructing URLs improves maintainability. Verify the new service reliably returns expected master URL. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
5. skymp5-client/src/services/services/authService.ts:334
- Draft comment:
readAuthDataFromDisk is now public. Confirm this change is safe and does not expose sensitive data unexpectedly. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
6. skymp5-client/src/services/services/loadOrderVerificationService.ts:25
- Draft comment:
Mod retrieval now delegates to SettingsService. Ensure that error handling/logging in SettingsService.getServerMods covers all edge cases. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
7. skymp5-client/src/services/services/settingsService.ts:118
- Draft comment:
Retry loop for getServerMods is clear. Consider adding more detailed logging or error handling if manifest parsing fails. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
8. skymp5-client/src/services/services/skympClient.ts:94
- Draft comment:
Connection establishment now uses SettingsService.getTargetPeer callback. Verify fallback mechanism (defaultPeer) behaves as expected when the request fails. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
9. skymp5-client/src/index.ts:66
- Draft comment:
Ensure SettingsService is initialized before dependent services are set up. Its position in the listeners array may affect services (e.g. AuthService) using it. - Reason this comment was not posted:
Comment looked like it was already resolved.
10. skymp5-client/src/services/services/authService.ts:196
- Draft comment:
Multiple lookups for SettingsService are performed. Consider caching the reference in a local variable to improve readability and avoid redundant lookups. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
11. skymp5-client/src/services/services/authService.ts:334
- Draft comment:
The method 'readAuthDataFromDisk' was changed from private to public. Confirm if this increased visibility is intended considering potential security concerns. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
12. skymp5-client/src/services/services/loadOrderVerificationService.ts:30
- Draft comment:
Using SettingsService.getServerMods() for server mod retrieval is appropriate. Ensure that the server mod list order is consistent with the client mod order for accurate comparisons. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
13. skymp5-client/src/services/services/skympClient.ts:94
- Draft comment:
In establishConnectionConditional, while using SettingsService.getTargetPeer looks good, consider adding error handling in the callback to handle cases where connection parameters fall back or connection fails. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
Workflow ID: wflow_Ue0bbzzFaxpwaV10
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
try { | ||
this.controller.lookupListener(TimersService).setTimeout( | ||
() => steps.reject(new Error('getTargetPeer: request timed out')), | ||
5000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timeout for getTargetPeer is hardcoded to 5000ms. Consider parameterizing this value or documenting its rationale for future configurability.
Important
Introduces
SettingsService
to centralize server settings management, refactoring related logic fromAuthService
andLoadOrderVerificationService
.SettingsService
insettingsService.ts
to manage server settings.getServerMasterKey()
,getMasterUrl()
,getTargetPeer()
, andgetServerMods()
.getServerMasterKey()
andgetMasterUrl()
fromAuthService
toSettingsService
.AuthService
andLoadOrderVerificationService
with calls toSettingsService
.SkympClient
to useSettingsService
for server connection details.SettingsService
handles server mod retrieval and peer targeting, improving flexibility and reducing redundancy.This description was created by
for 4d64152. It will automatically update as commits are pushed.