Feat(persistent-session): Implementation #41
Merged
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.
valtio
and it's dependencyshortSlug
workaround and use the Callout id instead, this makes sense because we have previously stored theshortSlugs
in memory and therefore do not need to make them persistent.Note
The database file is stored in the following directory:
telegram-bot/data
which should already be persistent in our Docker Compose stacks with has the Telegram Bot ServiceChecklist
After the bot has restated:
What is missing?
In order for the user to continue answering a callout with his last answer, we need to store the following data in the session:
With this data, we then have to jump back to the callout responses and skip the callout forms for the ones that have already been answered.
This data could be stored in the session inside the
CommunicationService.sendAndReceiveAll
method. This method is used to send the callout forms in sequence and to collect the responses / answers. The problem here is that I am currently not only storing pure data in the object of typeRenderResponse
, but also, for example, the keyboard, which is an instance of a class, and instances of a class cannot be persisted. So something would have to be restructured here what I'm not finished yet.However, I think that the PR can still be merged and the restoration of the callout answering can still be implemented afterwards. In this way, the persistent session could still be used for other features.