Conversation
This commit refactors the session management architecture to correctly handle data-based (`bytes`) sessions. Previously, the `Merchant` module was responsible for both payment processing and network access control via the `Valve`. This led to a critical flaw where data-based sessions were incorrectly granted a 24-hour time-based window, ignoring the purchased data allotment. The new architecture delegates session lifecycle management to the `Chandler` module, adhering to a proper separation of concerns. Key changes: - The `Merchant`'s responsibility now ends after processing a payment. It notifies the `Chandler` to start a session. - The `Chandler` is now the sole module responsible for creating the appropriate usage tracker and controlling the `Valve`. - A new `CustomerSessionTracker` has been introduced to monitor data usage for downstream customers and close the gate when the allotment is consumed. - The `Valve` has been updated with `OpenGate` and `CloseGate` functions to support indefinite data-based sessions. - Documentation has been added to explain the architectural changes and the new session flow.
Contributor
Author
|
Basic functionality seems to work but upstream usage-tracking seems out of sync, created branch Once we got top-ups and multi-hop stable we can add tracking client-side again. |
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.
Uh oh!
There was an error while loading. Please reload this page.