Refactor Logon and Logoff Services#104
Merged
Merged
Conversation
pheller
commented
Sep 17, 2025
Member
- They were becoming very difficult to reason through and the use of the with construct felt forced.
- Introduced a railway oriented approach to the processing pipeline - and_then will handle either invoking succeeding pipeline steps - perhaps adding to the pipeline context, or just pass errors through, letting the final step construct an appropriate response
da6539d to
8c8c7b8
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Logon and Logoff services to use a railway-oriented programming approach, replacing the previous with construct with an and_then pipeline pattern for better code clarity and error handling.
- Introduces railway-oriented programming with
and_thencombinators for linear processing pipelines - Breaks down complex monolithic functions into smaller, focused pipeline stages
- Consolidates error handling and response building logic
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/server/lib/prodigy/server/service/logon.ex | Complete refactor using railway pattern with pipeline stages for parsing, validation, authentication, and session management |
| apps/server/lib/prodigy/server/service/logoff.ex | Refactored to use railway pattern with improved error handling and cleaner separation of concerns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8c8c7b8 to
f29e69a
Compare
- They were becoming very difficult to reason through and the use of the with construct felt forced. - Introduced a railway oriented approach to the processing pipeline - and_then will handle either invoking succeeding pipeline steps - perhaps adding to the pipeline context, or just pass errors through, letting the final step construct an appropriate response
f29e69a to
848486b
Compare
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.