Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve context in postback payload & JWT #176

Closed
MrOrz opened this issue Apr 24, 2020 · 1 comment
Closed

Preserve context in postback payload & JWT #176

MrOrz opened this issue Apr 24, 2020 · 1 comment
Assignees

Comments

@MrOrz
Copy link
Member

MrOrz commented Apr 24, 2020

Under some scenario, user's manipulation will have unexpected results.

For instance, when the user is asked feedback from 2 replies in one search session, the user may want to give feedback to the former reply, but currently the chatbot always targets the last reply being displayed.

The root cause is the context (selectedArticleId, selectedReplyId) is not preserved when the postback or LIFF is invoked. If we preserve all context in JWT (for LIFF) or postback payload, we will be able to recover the context whenever the LIFF or postback is invoked.

To achieve this, the context should store as few data as possible. We should get rid of data.selectedArticleText and always read from DB (using selectedArticleId) instead. As for data.searchedText, the data is required to preserve in context, but we don't need to put it in JWT nor postback payload, since data.searchedText never change within one search session.

This picks up what is left behind after implementation of #49 .

@MrOrz
Copy link
Member Author

MrOrz commented Jun 22, 2022

Will address in #310

@MrOrz MrOrz closed this as completed Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant