Skip to content

Data nodes and local sync - Misc improvements 07/08 - #161

Merged
paul-fresquet merged 2 commits into
feature/data-nodes-and-local-syncfrom
feature/data-nodes-and-local-sync-misc-improvements
Aug 7, 2025
Merged

Data nodes and local sync - Misc improvements 07/08#161
paul-fresquet merged 2 commits into
feature/data-nodes-and-local-syncfrom
feature/data-nodes-and-local-sync-misc-improvements

Conversation

@paul-fresquet

Copy link
Copy Markdown
Contributor

This pull request refactors the session reset logic in the ByteSync server codebase, moving the responsibility from CloudSessionsService to a more granular command handler and repository approach. It also updates the corresponding unit tests and improves logging for better observability.

Refactoring session reset logic

  • The session reset operation has been moved from the CloudSessionsService class to the ResetSessionCommandHandler, which now directly interacts with ICloudSessionsRepository, IInventoryService, ISynchronizationService, ISharedFilesService, and IInvokeClientsService for a more modular and testable design. (src/ByteSync.ServerCommon/Commands/CloudSessions/ResetSessionCommandHandler.cs [1] src/ByteSync.ServerCommon/Services/CloudSessionsService.cs [2] [3] src/ByteSync.ServerCommon/Interfaces/Services/ICloudSessionsService.cs [4]

Logging and observability

  • Added detailed logging of loaded application settings in Program.cs and of session resets in the command handler for improved monitoring and troubleshooting. (src/ByteSync.Functions/Program.cs [1] src/ByteSync.ServerCommon/Commands/CloudSessions/ResetSessionCommandHandler.cs [2]

Unit test updates

  • The unit test for session reset (ResetSessionCommandHandlerTests) has been updated to verify calls to all involved services and repositories, ensuring the new logic is properly exercised and validated. (tests/ByteSync.ServerCommon.Tests/Commands/CloudSessions/ResetSessionCommandHandlerTests.cs [1] [2]

Dependency and interface cleanup

  • Removed unused dependencies and the now-obsolete ResetSession method from ICloudSessionsService, reflecting the new separation of concerns. (src/ByteSync.ServerCommon/Interfaces/Services/ICloudSessionsService.cs [1] src/ByteSync.ServerCommon/Services/CloudSessionsService.cs [2] [3] [4]

@paul-fresquet
paul-fresquet marked this pull request as ready for review August 7, 2025 05:33
@paul-fresquet
paul-fresquet merged commit 8369806 into feature/data-nodes-and-local-sync Aug 7, 2025
@paul-fresquet
paul-fresquet deleted the feature/data-nodes-and-local-sync-misc-improvements branch August 7, 2025 05:33
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.

1 participant