We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
當用 messenger 連續送出兩張圖時(發兩次對話),會導致 context.state 中,只有一張圖,且打卡完畢,仍然只有一張圖
context.state
不做了
"_state": { "isWorking":false, "startTime":null, "endTime":null, "location":null, "locationTimestamp":null, "imgUrls":[] }
做功德
"_state": { "isWorking":true, "startTime":"2018-01-06T05:21:58.709Z", "endTime":null, "location":null, "locationTimestamp":null, "imgUrls":[] }
"_state": { "isWorking":true, "startTime":"2018-01-06T05:21:58.709Z", "endTime":null, "location":null, "locationTimestamp":null, "imgUrls":[ "https://scontent-ort2-1.xx.fbcdn.net/v/t39.1997-6/p100x100/11057103_789355331153381_925532673_n.png?_nc_ad=z-m&_nc_cid=0&oh=c96dd949be1f29576e28f0420be6b66a&oe=5AF1D9C5" ] }
發現 state 沒有忠實儲存兩張圖片,經過多次測試,不一定會存到最後一張
這不是一個嚴重的問題,畢竟在 2~3 秒送多張圖片實在少見
在 https://github.com/goodjoblife/check-in-bot/blob/master/index.js#L241 這裏
應該把拿到的圖片存進資料庫,而不是 state 中
The text was updated successfully, but these errors were encountered:
No branches or pull requests
描述
當用 messenger 連續送出兩張圖時(發兩次對話),會導致
context.state
中,只有一張圖,且打卡完畢,仍然只有一張圖重現
不做了
,確保 state 被清空 (可以檢查 1 的 api 回傳或用 console.log 看)做功德
,檢查 state 應該是正常的發現 state 沒有忠實儲存兩張圖片,經過多次測試,不一定會存到最後一張
結論
這不是一個嚴重的問題,畢竟在 2~3 秒送多張圖片實在少見
可能的解法
在 https://github.com/goodjoblife/check-in-bot/blob/master/index.js#L241 這裏
應該把拿到的圖片存進資料庫,而不是 state 中
The text was updated successfully, but these errors were encountered: