Adding HTTP Session, And fixing
Opened this issue · 0 comments
medkhabt commented
REST API is supposed to be stateless, but I am storing the summoner name
in one of the services in the tracking module. It does cause any problems for now, or theoretically with the current set up. But it would be cleaner if it was in the httpsession. In case the user changed the account it should update the summoner name in the session. Also in case I have multiple frontend modules that call the same SSE endpoint (http://localhost:8999/games/live-game) ,
Scenario:
- the user started a game, and run the cli command to track the live game.
- the user died multiple times and the event was shown in the command line.
- the user start running the desktop app.
- the desktop app start tracking live game.
- [GOAL] the app should start showing the new events, and not show the old events.
To make this happen, I should alter the implementation of sent of events [ probably just sync the index of the new createdServerSentSession
with the existing one. Or in my case for now , make it static. And i need probably to store a list of SSeventEmitters instead of one.
Starting point for HTTP-sessions in spring : https://docs.spring.io/spring-session/reference/index.html