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
New article creation flow #172
Merged
Conversation
This file contains 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
…ge API restrictions
…ch result. Also fix the problem that duplicated UserInput event will be sent to Google analytics
Pull Request Test Coverage Report for Build 699
💛 - Coveralls |
nonumpa
reviewed
May 7, 2020
|
||
// Track text message type send by user | ||
const visitor = ga(userId, state, event.input); | ||
visitor.event({ ec: 'UserInput', ea: 'MessageType', el: 'text' }); | ||
visitor.event({ ec: 'UserInput', ea: 'MessageType', el: event.message.type }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If process.env.IMAGE_MESSAGE_ENABLED
is not true, image messages will not be tracked.
Maybe we can extract this along with index.js L168, index.js L179 to the beginning of process message.
[Cofacts Next] 告知 Chatbot 使用者新回應
automation
moved this from In progress
to Reviewer approved
May 8, 2020
LucienLee
approved these changes
May 8, 2020
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.
This PR rewrites
initState
handler, and createsaskingArticleSubmissionConsent
handler that replaces the originalaskingArticleSource
handler.What's covered
Chatbot Interactions within the red circle (LIFF not included)
Other things include:
issueAt
because it changes every reply.data.sessionId
is introduced instead. It changes only when the user submits new message.template
reply withflex
reply. This brings us benefits like:lengh <= 3
. Any text input that is not from LIFF can be considered as the start of a new search session.exp
(expire timestamp claim),MockDate
is introduced so that JWT can be deterministic across test runs.ga
and asserts what is being sent to Google analytics in unit tests.src/lib/sharedUtils
.ManipulationError
. It differs from normal runtime error, becausehandleInput
will catchManipulationError
and display its message in a nice flex reply. Very useful when we need to halt processing user input and display instruction to the user in reply.isNonsenseText()
logic because it's no longer used.initState
.What's not covered
CHOOSING_ARTICLE
and other state handlers are not updated accordingly, thus all other flows are not working yetprefix + option
on LINE, mimicking user interaction in LIFF.@auth
directive yet. Will implement when implementing LIFF.Screenshot
Submission flow with valid source
Submission flow with source that cannot proceed
Image text not found