Comment on #202 Convert GraphQL userArticleLinks to cursor-based pagination
Rebase and merge 看起來不會有 merge commit 呢囧 我還是用最傳統的 merge 好了,比較能從 commit 追 PR
Comment on #201 Feature/163 insert data
<https://github.com/godgunman|@godgunman> 你484改完忘記push
#206 Add google analytics to LIFF
• Google analytics setup for LIFF • sends pageview on page change • sends user timing on LIFF load • record redirect count as redirect event
Comment on #206 Add google analytics to LIFF
*Pull Request Test Coverage Report for <https://coveralls.io/builds/31779780|Build 978>* • *0* of *0* changed or added relevant lines in *0* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage remained the same at *98.379%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
Comment on #270 Hotfix/minor bugs
user id is used to identify whether the current user added the category as well (so that they can remove those categories added by themselves)(in line 298), `disableVote` may be a bit confusing. it's good to extract the author check logic to upper component though
Comment on #270 Hotfix/minor bugs
as for the mutation part it's certainly difficult to put them in appropriate place, `useMutation` is a hook and it uses closure to get required params, this means that we should put the params and `useMutation` in the same function, and at the same time consist the calling order so that it won't break hook rules
Comment on #269 Feature/reply editor toobar
1. `replyReference` does not look like a variable that is really needed. If we need this variable, please use `const` and replace `reply.text + '\n'` with `replyReference` instead. 2. Please remove unused comment. 3. Seems that we did not copy the reply reference to `ReferenceInput` yet?
Review on #269 Feature/reply editor toobar
The unit test looks clearer now :) Thanks! I think we are good to go after we implement reference copying on "Add this reply to my reply" button.
Review on #270 Hotfix/minor bugs
LGTM! I am seeing this warning when running `npm run dev`, not sure if it will cause errors: ``` Warning: fragment with name ArticleWithCategories already exists. graphql-tag enforces all fragment names across your application to be unique; read more about this in the docs: <http://dev.apollodata.com/core/fragments.html#unique-names> ``` Let's see it on staging.
*Before* <https://user-images.githubusercontent.com/108608/86210185-babaf000-bba6-11ea-9111-6c086ffce5b0.png|image> *After* <https://user-images.githubusercontent.com/108608/86210121-a37c0280-bba6-11ea-9a82-471e8e69d367.png|image>
Review on #271 [Trivial] Fix trendline
LGTM
Comment on #269 Feature/reply editor toobar
Thanks for adding `reference`. I think we should use `reply.reference` directly instead of composing from `reply.hyperlinks`. Sometimes the author of the reply may <https://old.cofacts.org/reply/ORLVmHEBrhVJn3LNJnmn|put some info in reply's reference field>, such as adding section title between hyperlinks, or provide description to URLs that is more concise to hyperlink titles.
Review on #269 Feature/reply editor toobar
LGTM! Thanks for the fix, let's see it in staging :sunglasses:
<https://github.com/cofacts/rumors-line-bot/issues/165|#165>
Comment on #207 Feature/165 cron notify
*Pull Request Test Coverage Report for <https://coveralls.io/builds/31796635|Build 984>* • *26* of *44* *(59.09%)* changed or added relevant lines in *4* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage decreased (*-4.7%*) to *93.679%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
facebook.com
LIFF SDK 現在也可以用 NPM 安裝了。另外安裝 NPM SDK,開發環境還有型別跟自動補完支援,寫起來效率滿分!
Comment on #207 Feature/165 cron notify
If we put cron job and web server together, there may be a case that if we have multiple instances for web server, the cron job will be triggered once for each instance, causing the job be run multiple times. I would suggest we just prepare a standalone NodeJS script that can be invoked via command line. On other environments, people can use native cron tab to trigger the script; and on Heroku, we can use <https://devcenter.heroku.com/articles/scheduler|Heroku scheduler> to schedule a run.
Comment on #207 Feature/165 cron notify
Since we already use `date-fns` in our application, I think we should use <https://date-fns.org/v2.14.0/docs/add|`date-fns/add`> directly, instead of implementing our own function.
Review on #207 Feature/165 cron notify
I haven't reviewed the core logic in determine who to notify. Just to provide some thought on how cron job can be defined and how user can be notified. I love the test cases, they helped me a lot when understanding how each utility function works :nerd_face:
Comment on #207 Feature/165 cron notify
I wonder if `push` is used anywhere yet?
Comment on #207 Feature/165 cron notify
I would suggest we send flex message with button when doing multicast, so that we can hide complex LIFF URLs from users using a button with URI action.
Comment on #207 Feature/165 cron notify
If there are multiple instances running the web server, this may cause the cron job being run once for each instance / process. I would suggest we just implement a NodeJS script that can be run using command line. On normal production environment, the devOp can use ordinary cron tab to trigger the job; on our production environment on Heroku, we can use <https://devcenter.heroku.com/articles/scheduler|Heroku scheduler>. In this case, we won't need `CronJob` library; we just need to make sure the script works when run on CLI, just like the <https://github.com/cofacts/rumors-api/blob/master/src/scripts/cleanupUrls.js#L136-L138|hyperlink cleaning job> in rumors-api.
Comment on #207 Feature/165 cron notify
no, currently we just use `multicast` and `notify`.
Add user id field to CreateArticleCategory
g0v.hackmd.io
Comment on #201 Feature/163 insert data
Why don't we just use mongo client for a find query? (Also for L118) The main point of my previous comment was because `UserSetting.findOrInsertByUserId` will mutate the database to make the test pass, even when the function under test (`singleUserHandler`) does not work as expected. It did not mean we should avoid using `mongoClient` entirely ._.
Review on #201 Feature/163 insert data
Thanks for updating the PR accordingly! Named a few suggestions and added conclusion from the discussion <https://g0v-tw.slack.com/archives/C2PPMRQGP/p1593850412237300|on Slack> today.
Comment on #201 Feature/163 insert data
There is already a static method called `find` in `UserArticleLink`, which is used by GraphQL resolver for `Query.userArticleLinks`. `find` was added before this branch previously branched out and is now in the file after your rebase. I think we should only leave one endpoint that lists user-article links of a user. I like the naming `findByUserId` because it is more clear (and considering that we need also to find by article id in <https://github.com/cofacts/rumors-line-bot/pull/207|#207>). But the pagination mechanism is also required by the GraphQL API. Would you merge the implementation of the two find methods into `findByUserId()`, remove `find()` and update the resolver (`graphql/resolvers/Query.js`) accordingly?
Comment on #201 Feature/163 insert data
Since `choosingReply` does not involve `UserArticleLink`, I think we should not include these in test file, or it may confuse readers thinking that `choosingReply` has used `UserArticleLink`.
Comment on #201 Feature/163 insert data
As discussed in slack today, we should use an API that also writes `lastViewedAt`. Also, please add `lastViewedAt` as a required field in `userArticleLink.json` to ensure that `lastViewedAt` always exists in DB.
Comment on #201 Feature/163 insert data
Actually there is another method called `findOrInsertByUserIdAndArticleId` in `UserArticleLink` model, doing almost the same thing as `updateTimestamps` does, but it's not used anywhere. I suggest we should leave only one of such method in `UserArticleLink`.
Comment on #207 Feature/165 cron notify
1. Accepting inputting multiple `articleIds` and search by `{articleId: {$in: articleIds}}` can provide better flexibility. It should work more efficiently as well. 2. Since this API still returns `UserArticleLink`s instead of users, the `UserList` in its naming is a bit confusing. suggest using something like `findByArticleIds`.
Comment on #207 Feature/165 cron notify
According to <https://g0v-tw.slack.com/archives/C2PPMRQGP/p1593850412237300|our discussion on slack>, all `userArticleLink` should have `lastViewedAt`. We may need to update these fixtures to match that.
Comment on #207 Feature/165 cron notify
I suggest we move some of the `articleReply`'s `createdAt` outside of the queried time range because • `ListArticle(repliedAt)` includes an article as long as it has _one_ `articleReply` within the time range, thus it is possible for its results having _some_ article-replies outside the time range • Including such possibility in the test case can better cover all scenarios • Currently there are already plenty of `articleReplies` in the fixture, but all of them in the same time range. Moving some of them outside the time range can increase diversity of fixture combinations.
Review on #207 Feature/165 cron notify
I have viewed the logic of cron jobs. Thanks for the contribution! As our <https://datastudio.google.com/u/0/reporting/18J8jZYumsoaCPBk9bdRd97GKvi_W5v-r/page/ckUQ|open data analytics> shows, sometimes there will be more than 100 articles replied in a day. I have made some suggestions to enhance robustness of cron jobs by processing in batches. Also there are some suggestions about diversity of test fixtures.
Comment on #207 Feature/165 cron notify
The combination of `Promise.all` and `....map()` will cause `UserSettings.findOrInsertByUserId` being invoked in parallel. If there are `N` users to notify, this will trigger `N` queries to database _at once_. This can be dangerous when a very popular article (>100 user article links) receives a new reply. I would suggest • Divide `Object.keys(notificationList)` (user ids) into batches, size of each batch controlled by a constant. • Use for-loop with `await` in loop to make sure only 1 batch is processed at a time. • Create a new static method on `UserSettings` that reads user settings in batch and does not perform upsert. • use `findAll({userId: {$in: userIds}})` in the new method to receive batch of user settings • there is no point inserting `UserSettings` in cron jobs • skip a user when the user does not have `UserSettings` (it should never happen though, just in case)
Comment on #207 Feature/165 cron notify
Sending one notification for each user that receive notification may <https://developers.google.com/analytics/devguides/collection/analyticsjs/limits-quotas|hit this quota> if there are more than 20 users to send notification: > Each gtag.js and analytics.js tracker object starts with 20 hits that are replenished at a rate of 2 hits per second I think for now we can just send one event to GA that records the number of notifications we sent this time (in <https://developers.google.com/analytics/devguides/collection/analyticsjs/events|event value> so that the number adds up when query for multiple days).
Comment on #207 Feature/165 cron notify
These comments will be sent as part of GraphQL. I think we can remove these comments because the variable name already implies the same meaning.
Comment on #207 Feature/165 cron notify
Suggest adding `status:NORMAL` to exclude deleted replies
Comment on #207 Feature/165 cron notify
For processing the articles, I would suggest 1. Use pagination to get _all_ articles that match the filter, not just first `N` articles. 2. Sequentially process each batch of `N` articles. Design APIs so that it can handle multiple articles at once. ``` // Async generator that gets a batch of articles with articleReply between `from` and `to`. // The generator encapsulates complex pagination logic so that the function using it can focus on // batch processing logic without worrying pagination. // async function* getArticlesInBatch(from, to) { // Get pageInfo outside the loop since it's expensive for rumors-api const { data: { ListArticles: { pageInfo: {lastCursor} } } } = await gql`...`({from, to}); let after = undefined; while(lastCursor !== after) { // Actually loads `edges` and process. const { data: { ListArticles } } = await gql`...`({from, to, after}); yield ListArticles.edges.map(({node}) => node); // next gql call should go after the last cursor of this page after = ListArticles.edges[ListArticles.edges.length - 1].cursor; } } async function getNotificationList(lastScannedAt, nowWithOffset) { const result = {}; // for loop ensures that only one batch will be processed at a time, so that we do not // make a bunch of queries to our MongoDB at once. // for await (const articles of getArticlesInBatch(lastScannedAt, nowWithOffset)) { // Process the batch // Make an API that processes a batch of articleIds, instead of only one ID at a time const userArticleLinks = await UserArticleLink.findByArticleIds(articles.map(({id}) => id)); userArticleLinks.forEach(/* Logic that populates result */) } return result; } ```
Comment on #201 Feature/163 insert data
Should we test if `unfollow` event changes `allowNewReplyUpdate` to false?
Comment on #272 hotfix: add category bug
Still can't remove a category added by myself from the article detail page. The category first seems to deleted, but re-appear after refresh. I am seeing this warning in console. Not sure if it is relevant. > Warning: fragment with name ArticleWithCategories already exists. > graphql-tag enforces all fragment names across your application to be unique; read more about > this in the docs: <http://dev.apollodata.com/core/fragments.html#unique-names|http://dev.apollodata.com/core/fragments.html#unique-names> I found that • there is no `status` exist in fetched `articleCategories` in apollo cache. • when querying article's `articleCategories` we did not specify `(status: NORMAL)` in GraphQL. I guess that's probably why all `articleCategories` are fetched and displayed. Since the display logic actually do not involve `status`, I suggest specifying `(status: NORMAL)` when querying `articleCategories` in article detail page.
Comment on #201 Feature/163 insert data
Hmm, because you say `using MongoDb commands` :joy::joy: . It's a bit confusing for me, but doing mongo CLI is also quick, then I made it haha
Comment on #201 Feature/163 insert data
How about we move `find()` into `src/database/models/base.js` ? So that all models can use `find()` just like they already have `findOneAndUpdate`. As a result, `findByUserId()` is for listing user-article links in UserArticleLink, and `find()` is for general use in all models.
Comment on #201 Feature/163 insert data
But mongodb already have a method named `find()`. I would like to see `findXXX` methods directly invoking methods of mongodb client. Adding one more layer to `find()` is a bit over-engineered to me.
Comment on #201 Feature/163 insert data
Agree adding `find()` to `Base` so that `Base` API is more consistent :woman-gesturing-ok:
Review on #272 hotfix: add category bug
It's working properly now. Thanks for the fix!
Discussion: <https://g0v.hackmd.io/@mrorz/cofacts-meeting-notes/%2F%40mrorz%2FByKAmKITU|https://g0v.hackmd.io/@mrorz/cofacts-meeting-notes/%2F%40mrorz%2FByKAmKITU> > orz: Google 有針對 ClaimReview 做一個專門的 search box 耶:<https://toolbox.google.com/factcheck/explorer|https://toolbox.google.com/factcheck/explorer> (預設只會顯示瀏覽器語言的 fact-check result) > 好像也有 Search API: <https://toolbox.google.com/factcheck/apis|https://toolbox.google.com/factcheck/apis> > Lucien: 要不要做在 API server > 就能查完直接送進 DB > 或者轉換為一種 reply
#273 Revamp deleted reply list in article page
Spec: <https://g0v.hackmd.io/dYT7zCPGQiKsTne7-kkybw|https://g0v.hackmd.io/dYT7zCPGQiKsTne7-kkybw> Directions: only show deleted article-reply to its author
add troubleshooting section for an error encountered during setup
add configuration step
Comment on #180 Update README.md
<https://coveralls.io/builds/31882251|Coverage Status> Coverage remained the same at 86.826% when pulling *<https://github.com/cofacts/rumors-api/commit/b65fd038d3a7575e6835d297b21f357675c84f9f|b65fd03> on readme_grpc* into *<https://github.com/cofacts/rumors-api/commit/8ca66a996c9cb8e09da67c5d05e71d32e875ff77|8ca66a9> on master*.
Review on #43 Update README.md
Thanks for the info!
Review on #180 Update README.md
Thank you for adding troubleshooting info!
HackMD
HackMD - Collaborative Markdown Knowledge Base
## 大松主持會議 - 各專案外包主持小心得 ### 源起 揪松團想成為更為多中心化的組織,因此將每次大松的「例行主持」外包給其他單位。 ### 例行主持工作內容 0. 松前哈拉 1. 介紹新手教
added schema for analytics per spec at <https://g0v.hackmd.io/0kjaVlFASSyddkltqGR6Nw|https://g0v.hackmd.io/0kjaVlFASSyddkltqGR6Nw>
Review on #44 add schema for analytics
LGTM! Sorting imports and exports looks so organized. I think we can also include the `docUsrrId` as discussed in one of the comment <https://g0v.hackmd.io/0kjaVlFASSyddkltqGR6Nw|https://g0v.hackmd.io/0kjaVlFASSyddkltqGR6Nw>
#17 Move generated zip files to git-lfs instead
This should make pusing & cloning this repo easier <https://github.blog/2018-07-30-git-lfs-2-5-0-now-available/|https://github.blog/2018-07-30-git-lfs-2-5-0-now-available/>
Comment on #13 some fields are not properly double-quoted in csv
Closing due to inactivity
Review on #44 add schema for analytics
LGTM! Let's merge it
Comment on #166 Implement Google analytics stats field in Article
*Server side todo list* ☑︎ update schema <https://github.com/cofacts/rumors-db/pull/44|cofacts/rumors-db#44> ☐ fetch data from google analytics and store in elasticsearch ☑︎ oAuth & google API ☐ insert/upsert data to elasticsearch & query to populate docUserId ☐ unit test ☐ data loader: (article ids) -> stats ☐ unit test ☐ new API endpoint to query for stats of a particular article ☐ unit test
#208 Update translation to avoid interpolation error
Fix release blocker found in 20200708 meeting <https://g0v.hackmd.io/ehzopA3fScSn9PjkBM79bA#%E2%9B%94%EF%B8%8F-Release-Blockers|https://g0v.hackmd.io/ehzopA3fScSn9PjkBM79bA#%E2%9B%94%EF%B8%8F-Release-Blockers> *Typo fix* <https://user-images.githubusercontent.com/108608/86963788-a2933400-c197-11ea-81a6-e2600db09577.png|image> *Translation* The original variable collides with other occurrence. Fixed translation by choosing a different variable name. Note: actually there are some other places that has variable name collision, but ttag still works there. Not sure it does not work this time. <https://user-images.githubusercontent.com/108608/86963620-65c73d00-c197-11ea-909c-cfed763cf979.png|image>
Comment on #208 Update translation to avoid interpolation error
*Pull Request Test Coverage Report for <https://coveralls.io/builds/31948667|Build 1018>* • *1* of *1* *(100.0%)* changed or added relevant line in *1* file are covered. • No unchanged relevant lines lost coverage. • Overall coverage remained the same at *98.379%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
Subscribed to the following accounts
<https://github.com/cofacts|cofacts>
Subscribed to the following accounts
<https://github.com/cofacts|cofacts> `issues`, `pulls`, `public`, `comments`, `reviews`
This channel will get notifications from <https://github.com/cofacts|cofacts> for: `issues`, `pulls`, `comments`, `reviews`
New release scheduled for 2020/7/10 midnight. *Features* <https://github.com/cofacts/rumors-line-bot/pull/185|#185> User setting LIFF <https://github.com/cofacts/rumors-line-bot/pull/197|#197> Loads user article link <https://github.com/cofacts/rumors-line-bot/pull/198|#198> Lists user article link and data from Cofacts API <https://github.com/cofacts/rumors-line-bot/pull/199|#199> Styling user article link LIFF <https://github.com/cofacts/rumors-line-bot/pull/200|#200> Handle clicking user article link <https://github.com/cofacts/rumors-line-bot/pull/203|#203> user article link pagination *Refactor item* <https://github.com/cofacts/rumors-line-bot/pull/194|#194> LIFF auth check relaxed <https://github.com/cofacts/rumors-line-bot/pull/195|#195> Svelte eslint <https://github.com/cofacts/rumors-line-bot/pull/196|#196> unit test for svelte *Bugfix* <https://github.com/cofacts/rumors-line-bot/pull/208|#208> translation fix *Release test result* <https://g0v.hackmd.io/ehzopA3fScSn9PjkBM79bA#Testing-checklist|https://g0v.hackmd.io/ehzopA3fScSn9PjkBM79bA#Testing-checklist>
Comment on #209 20200710 Release
*Pull Request Test Coverage Report for <https://coveralls.io/builds/31957857|Build 1020>* • *139* of *139* *(100.0%)* changed or added relevant lines in *12* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage decreased (*-0.06%*) to *98.379%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
Comment on #204 Feature/backtrack user
As <https://g0v.hackmd.io/eIeU2g86Tfu5VnLazNfUvQ#%E8%B3%87%E6%96%99%E8%A1%A8%EF%BC%9AUserArticleLinks|we recently discussed>, we no longer need to populate `lastRepliedAt` :free:
#181 Integrate with google analytics reporting API
write a script to fetch page view stats from google analytics and store in elasticsearch ☑︎ oAuth & google API ☐ query to populate docUserId ☐ insert/upsert data to elasticsearch ☐ unit test
#182 Implement data loader for analytics
implement a data loader that returns page view stats when given article ids ☐ data loader: (article ids) -> stats ☐ unit test
#183 Implement API endpoint to query for analytics stats
☐ new API endpoint to query for stats of a particular article ☐ unit test
Comment on #206 Add google analytics to LIFF
I forgot to note the new GA event / pageview in README.
#274 Fold hyperlink previews in detail pages
Implement hyperlink folding when there are more than 4 hyperlinks. <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=2079%3A939|Visual spec> <https://user-images.githubusercontent.com/108608/87218122-81426b80-c382-11ea-9f4b-d8852d09f385.png|image> • 1~3 hyperlinks: show all • 4+ hyperlinks: fold to 2 hyperlinks and a "show" button • No "collapse" button after expansion
#275 Use SVG to implement ribbon tails
The ribbon tails are not aligned in narrower screen: <https://user-images.githubusercontent.com/108608/85220902-e3422d80-b3e1-11ea-8c1f-719c6cd6f15a.png|image> (Actually the ribbon in the profile menu is not aligned either.) Since it's difficult calculating border-size to place these triangles, I would suggest using svg instead. It's shape is so simple that we can write the svg <https://www.oxxostudio.tw/articles/201406/svg-04-path-1.html|by hand>: ``` <svg viewBox="0 0 1 2"> <path d="M0 0 H1 L0 1 L1 2 H0 Z" /> </svg> ``` And we get a ribbon tail that we can resize and recolor using CSS. _Originally posted by <https://github.com/MrOrz|@MrOrz> in <https://github.com/cofacts/rumors-site/pull/264|#264>_
#276 Markdown-like logic for list items in Cofacts editor
*As-is* <https://user-images.githubusercontent.com/108608/87218656-4262e480-c387-11ea-8b3a-2546fda7d756.png|image> *To-be* Interactions like this: <https://user-images.githubusercontent.com/108608/87218543-6540c900-c386-11ea-9f10-297ae7260953.gif|interactions> This interaction should be achieved by • performing list processing logic (in <https://github.com/cofacts/rumors-site/blob/dev/lib/editor.js|lib/editor>) when "enter" is pressed and when toolbar button is pressed • when performing logic, find the line the cursor is in, then add / remove "- " or "N. " accordingly • [nice-to-have] support predefined set of list bullets `-`, `*`, or `•` in <https://g0v.hackmd.io/Cx7dQo3YTQS4KwYmYCBY8w#%E6%92%B0%E5%AF%AB%E6%96%B0%E5%9B%9E%E6%87%89|spec> and/or numbering `1.`, `1️⃣`, etc
Comment on #127 Hide articles with only 1 reply request & its reason is too short
Closing because we now have better filter mechanism
#184 UpdateReply API and replyUpdateBlocker field for reply
As discussed in <https://g0v.hackmd.io/@mrorz/cofacts-meeting-notes/%2F%40mrorz%2Fr1dQQZbmU|20200212 meeting>, we want to allow editor to edit their reply when • The reply is only used by the editor itself (the author should know the impact of the edit) • The reply has not yet received any feedback (the edit should now invalidate user's feedbacks) We plan to add 1 mutation API, and one new field to `Reply` type for this: ``` """ The reason why the editor cannot edit """ enum ReplyUpdateBlocker { NOT_AUTHORIZED # Not logged in or not the author of reply HAS_FEEDBACK USED_BY_OTHER_EDITORS } type Reply { """ The reason why the current user cannot edit this reply. null if the current user can edit. The blockers are determined in the following order: (1) current user is the author or not (2) `positiveFeedbackCount` and `negativeFeedbackCount` are both 0 or not (3) all normal article-reply to this article are by the current author or not """ updateBlocker: ReplyUpdateBlocker } mutation { """ Updates reply text, type & reference when (1) current user is the author (2) `positiveFeedbackCount` and `negativeFeedbackCount` are both 0 (3) all normal article-reply to this article are by the current author """ UpdateReply( replyId: String! text: String type: ReplyTypeEnum reference: String waitForHyperlinks: Boolean = false ) { ""' The reply after update. `null` when update is not successful """ reply: Reply """ The reason why update fails. null when can update. """ blocker: ReplyUpdateBlocker } } ``` "all normal article-reply to this article are by the current author" can be achieved by loading article-reply of a reply using <https://github.com/cofacts/rumors-api/blob/master/src/graphql/dataLoaders/articleRepliesByReplyIdLoaderFactory.js|`articleRepliesByReplyIdLoader`> and check each article-reply's author ID.
Line bot that checks if a message contains internet rumor.
g0v.hackmd.io
#277 Block anonymous user from clicking "Reply to this message" and "Comment" button
*As-is* *Desktop* *Reply to this message* Expands an empty section <https://user-images.githubusercontent.com/108608/87222646-0a1fce00-c3a8-11ea-893d-e4d53abb1d11.gif|Jul-11-2020 18-54-42> *Comment section* Allows user to input long comments, but block on submission <https://user-images.githubusercontent.com/108608/87222771-4d2e7100-c3a9-11ea-8c49-14663aa03f00.gif|comment-click> *Mobile* Block the user from doing anything...... <https://user-images.githubusercontent.com/108608/87222669-36d3e580-c3a8-11ea-981f-c315f72f2cc6.gif|mobile> *To-be* <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO?node-id=2011:0#30609561|Designers said>: <https://user-images.githubusercontent.com/108608/87222711-ba8dd200-c3a8-11ea-9713-49e4e1f5874a.png|image> Let's keep the buttons clickable, but add an `alert()` asking the user to login immediately after it's clicked. (Popping up login screen can be even better, but it's a bit more difficult to achieve.)
#278 Hint editors on mobile to fill in references
According to <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=1302%3A18|spec> <https://camo.githubusercontent.com/f716a22c8201eb9412adee1cf38a27f0654bc3fc/68747470733a2f2f73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6730762d6861636b6d642d696d616765732f75706c6f6164732f75706c6f61645f64613931626237623562396232656630356236636364653461356138626532372e706e67|Reference red dot> Please add a <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=1302%3A18|Material UI Dot Badge> on the "Reference" tab when the user did not enter reference yet.
#279 Keyboard on Android is covering up editing area too much
See recording <https://drive.google.com/file/d/1aET09JJ_AxgFkRUDLYqR2CV3L4AAkagB/view?usp=sharing|https://drive.google.com/file/d/1aET09JJ_AxgFkRUDLYqR2CV3L4AAkagB/view?usp=sharing> We should allow Android users to be able to scroll down to access full editing area
#280 iOS users cannot perform search
After iOS users finish input in top search bar, the search bar would disappear. Here is a simulation using Safari: <https://user-images.githubusercontent.com/108608/87223969-cf239780-c3b3-11ea-801a-95ac7359087c.gif|ios search> On real iOS devices, as long as soft keyboard is dismissed, the search bar disappears. Replacing the current on-blur mechanism with Material-UI <https://material-ui.com/components/click-away-listener/#click-away-listener|Click-away listener> should work.
#281 Search bar input should span multiple rows
*As-is* The search input in search page is only 1 line high <https://user-images.githubusercontent.com/108608/87224213-0004cc00-c3b6-11ea-9365-51316eeb015d.gif|search> *To-be* As <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=432%3A2727|in spec>, the search input should grow as input. <https://user-images.githubusercontent.com/108608/87224366-4575c900-c3b7-11ea-8255-57ca43ff249a.png|image> This should be achievable using Material UI's <https://material-ui.com/components/textarea-autosize/|Textarea autosize>.
See items in read text in: <https://docs.google.com/presentation/d/18VnEBMr9m-t81ppRwHcjbA1keltg-CIn7wUF9pu1oLo/edit#slide=id.g885e62dcbb_0_75|https://docs.google.com/presentation/d/18VnEBMr9m-t81ppRwHcjbA1keltg-CIn7wUF9pu1oLo/edit#slide=id.g885e62dcbb_0_75> Spec: <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=681%3A0|https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=681%3A0>
Should add icons & levels. See p1, p5 in <https://docs.google.com/presentation/d/18VnEBMr9m-t81ppRwHcjbA1keltg-CIn7wUF9pu1oLo/edit#slide=id.p|https://docs.google.com/presentation/d/18VnEBMr9m-t81ppRwHcjbA1keltg-CIn7wUF9pu1oLo/edit#slide=id.p> Visual spec: <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=681%3A0|https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=681%3A0>
#284 Fix logout in mobile menu
Clicking this button has no effect: <https://user-images.githubusercontent.com/108608/87224542-a18d1d00-c3b8-11ea-86dd-fb40784e3aba.png|截圖 2020-07-11 下午8 53 04> It should work the same as its desktop counterpart.
#285 “Add this reply to my reply” failed to copy reference
After clicking “Add this reply to my reply” on searched result in editor, the contents of the copied reply appears in text area, but references shows "undefined". <https://user-images.githubusercontent.com/108608/87227845-0acc5a80-c3d0-11ea-8348-213a6e2ac28d.png|image>
Comment on #9 data visualization
A connector is no longer needed, the visualizations are connected to google cloud storage open data CSV files now. Closing.
#185 Generate User ID for each backend app user
Implement "Direction 2" in <https://g0v.hackmd.io/ZcoUOX_-RQSkJyl5xz4_Zg#%E6%96%B9%E5%90%91-2-%E9%87%9D%E5%B0%8D%E6%AF%8F%E5%80%8B-backend-user-%E9%83%BD%E7%94%A2%E7%94%9F%E4%B8%80%E5%80%8B-user-document|userId & appId management proposal>. ☐ <https://github.com/cofacts/rumors-db/tree/create-user|Migration script> • adds user for backend app articles, reply-requests & article-reply feedbacks ☐ API change • organize auth & login routes • create user when resolving user
#286 ArticlePageLayout refactor
*Related bugs* • Search page 應該 sort by relevance • Replied by me filter 目前是壞的 • Latest reply 頁面卻有沒回應過的訊息 *目標* • 不同頁面使用不同 filter • 不同頁面使用不同 sort • 不同頁面顯示不同 UI、載入不同資料 *進行* ArticlePageLayout (可疑訊息、最新查核、等你來答、搜尋頁面) 的 refactor 預計會這樣進行: <https://g0v.hackmd.io/h8rP0TOGTh2Clxi_Oi_QKw|https://g0v.hackmd.io/h8rP0TOGTh2Clxi_Oi_QKw> 1. 會影響列表的 controls (如 filter, search, more button) 直接對 URL param 讀寫。單純化的 component input / output 有利於在各個 page components 重用。 2. page components 管理 data loading,讀取 URL param 之後拼湊成 graphql query。各頁面有特殊 Query 需求,也是在這個階段對 graphql query 加蔥。 3. 將會分 3 個 pull request 進 code *進度* ☐ Packaging input components • <https://github.com/cofacts/rumors-site/pull/267|#267> , <https://github.com/cofacts/rumors-site/pull/268|#268> ☐ Packaging display components: Header, layouts, list items 抽成 component,檢視其 props 設計 ☐ Extract logic to page
dev.cofacts.org
Cofacts - Connecting facts and instant messages
Cofacts is a collaborative system connecting instant messages and fact-check reports or different opinions together. It’s a grass-root effort fighting mis/disinformation in Taiwan.
Medium
200 OK! Error Handling in GraphQL
We all know how great GraphQL is when things go well, but what happens when things don’t go well?
#287 [Trivial] Cleanup makeStyle className serial numbers
`makeStyle`'s serial number in classnames often cause storyshots to change as we write new stories, resulting in irrelevant code changes in pull requests. This PR removes the serial number from snapshots so that the snapshots can be more independent from each other.
2nd planned PR for `ArticleListPage` component revamp
#289 Reorganize files and extract common components
This is about cleaning up and pave way to the ArticlePageLayout refactor PR (<https://github.com/cofacts/rumors-site/pull/288|#288> ) TBD
#290 Update ExpandableText and extract Tooltip
These are minor improvements made during implementation of main refactor <https://github.com/cofacts/rumors-site/pull/288|#288> ; isolated as a new PR to make the main PR clean. *Features* • Extract `<Tooltip>` from `ArticleInfo`'s `CustomTooltip` • Fine-tune style so that font size, margin and padding matches <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=436%3A441|the mockup> • Replaces all Material-UI `Tooltip` usage to the customized version *Refactors* • Updated `<ExpandableText>` to support background color other than white • This will be required when we implement `ArticleItem`'s "visited" state • Reads new CSS variable `--background` • Use `mask-image` to implement gradient background (because we cannot turn `var(--background)` transparent and put it in as a color stop in color gradient directly) • Add ellipsis in `wordCount` mode • Adjust button style
Comment on #201 Feature/163 insert data
Will this fill in `lastViewedAt`?
Comment on #207 Feature/165 cron notify
• nit: we can add `s` to function name (`findByUserIds`) to align with `UserArticleLink.findByArticleIds`
Review on #207 Feature/165 cron notify
Looks in a good shape! I have some trivial comments here, but in general we are good to go!
Comment on #207 Feature/165 cron notify
If this is for dev only, how about we use `babel-node` to run `src/scripts/scanRepliesAndNotify` instead of building the entire project?
#291 Feedbacks from LINE bot is not shown in "show more" button dialog
• Left: Current production website. When "show more" is clicked, many feedback are not shown. • Right: Old cofacts website, displaying all feedbacks (old websites don't differentiate upvote / downvote, though). <https://user-images.githubusercontent.com/108608/87278239-8d5f3200-c516-11ea-8988-f2f6d4faa556.png|image> API can correctly return all feedbacks, so it's UI issue. <https://user-images.githubusercontent.com/108608/87278400-f3e45000-c516-11ea-8275-3c17c4992b39.png|image> Bug found during <https://g0v.hackmd.io/ehzopA3fScSn9PjkBM79bA#%E6%9C%AA%E7%AB%9F%E9%A0%85%E7%9B%AE|20200708 release check>.
Figma
Created with Figma
Figma
Created with Figma
HackMD
# 撰寫回應小撇步 :::danger - 狀態:草稿 - 撰寫要點 - 分不同 reply type,提供不同 tip 與範例 - 每個 tip 在兩段內,每段 100 字內 -
Comment on #201 Feature/163 insert data
Duplicate calling `findByUserId` .
Comment on #201 Feature/163 insert data
Duplicate calling `findByUserId` .
Comment on #184 UpdateReply API and replyUpdateBlocker field for reply
As discussed in <https://g0v-slack-archive.g0v.ronny.tw/index/channel/C2PPMRQGP/2020-07#ts-1594556835.293700|https://g0v-slack-archive.g0v.ronny.tw/index/channel/C2PPMRQGP/2020-07#ts-1594556835.293700> The return type of the API can leverage union type, <https://medium.com/@sachee/200-ok-error-handling-in-graphql-7ec869aec9bc|as Medium suggested>.
Comment on #191 Error: user doesn't grant required permissions yet
After testing, this error message only shows on iOS if user didn't allow `send messages to chat` permission but still try to trigger a button that will call `liff.sendMessages`. <https://user-images.githubusercontent.com/6376572/87516185-91728780-c6af-11ea-9c82-882818dc3017.png|https://user-images.githubusercontent.com/6376572/87516185-91728780-c6af-11ea-9c82-882818dc3017.png> Although Line will always ask for permission every time liff opening if user didn't grant, for better user experience, we should handle <https://developers.line.biz/en/reference/liff/#return-value-19|LiffError> returns from `liff.sendMessages`.
Comment on #184 UpdateReply API and replyUpdateBlocker field for reply
As discussed in <https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E8%A8%8E%E8%AB%96%EF%BC%9A%E8%AE%93%E4%BD%9C%E8%80%85%E8%83%BD%E7%B7%A8%E8%BC%AF%E5%9B%9E%E6%87%89|https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E8%A8%8E%E8%AB%96%EF%BC%9A%E8%AE%93%E4%BD%9C%E8%80%85%E8%83%BD%E7%B7%A8%E8%BC%AF%E5%9B%9E%E6%87%89> the priority of this item is set to `low`.
Comment on #191 Error: user doesn't grant required permissions yet
I have a bold idea. When we catch `liffError`, we can explain that we need "Send messages to chats" just because we want to send message back to Cofacts, then provide a button that reads "Go back and click 'send' by myself". The button is actually a link to a LINE URL scheme that <https://developers.line.biz/en/docs/line-login/using-line-url-scheme/#sending-text-messages|sends text to an official account>, in this case, `@cofacts`. One example to such link is: <https://line.me/R/oaMessage/@cofacts/?%F0%9F%91%8D%20%E9%80%99%E5%80%8B%E5%9B%9E%E6%87%89%E5%BE%88%E6%9C%89%E7%94%A8%EF%BC%8C%E6%88%91%E6%83%B3%E8%A3%9C%E5%85%85%3A%0Atest|https://line.me/R/oaMessage/@cofacts/?%F0%9F%91%8D%20%E9%80%99%E5%80%8B%E5%9B%9E%E6%87%89%E5%BE%88%E6%9C%89%E7%94%A8%EF%BC%8C%E6%88%91%E6%83%B3%E8%A3%9C%E5%85%85%3A%0Atest> Then we can put the text previously in `sendMessage()` into the URL scheme, so that when the user clicks the button, the URL scheme will bring them back to `@cofacts` chat screen, with message to send inside their text dialog. When the user clicks "send" button, the chatbot receives the message (prefixed with LIFF prefixes), and then proceed the steps.
#292 Bump lodash from 4.17.15 to 4.17.19
Bumps <https://github.com/lodash/lodash|lodash> from 4.17.15 to 4.17.19. Release notes _Sourced from <https://github.com/lodash/lodash/releases|lodash's releases>._ > *4.17.16* Commits • <https://github.com/lodash/lodash/commit/d7fbc52ee0466a6d248f047b5d5c3e6d1e099056|`d7fbc52`> Bump to v4.17.19 • <https://github.com/lodash/lodash/commit/2e1c0f22f425e9c013815b2cd7c2ebd51f49a8d6|`2e1c0f2`> Add npm-package • <https://github.com/lodash/lodash/commit/1b6c282299f4e0271f932b466c67f0f822aa308e|`1b6c282`> Bump to v4.17.18 • <https://github.com/lodash/lodash/commit/a370ac81408de2da77a82b3c4b61a01a3b9c2fac|`a370ac8`> Bump to v4.17.17 • <https://github.com/lodash/lodash/commit/1144918f3578a84fcc4986da9b806e63a6175cbb|`1144918`> Rebuild lodash and docs • <https://github.com/lodash/lodash/commit/3a3b0fd339c2109563f7e8167dc95265ed82ef3e|`3a3b0fd`> Bump to v4.17.16 • <https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12|`c84fe82`> fix(zipObjectDeep): prototype pollution (<https://github-redirect.dependabot.com/lodash/lodash/issues/4759|#4759>) • <https://github.com/lodash/lodash/commit/e7b28ea6cb17b4ca021e7c9d66218c8c89782f32|`e7b28ea`> Sanitize sourceURL so it cannot affect evaled code (<https://github-redirect.dependabot.com/lodash/lodash/issues/4518|#4518>) • <https://github.com/lodash/lodash/commit/0cec225778d4ac26c2bac95031ecc92a94f08bbb|`0cec225`> Fix lodash.isEqual for circular references (<https://github-redirect.dependabot.com/lodash/lodash/issues/4320|#4320>) (<https://github-redirect.dependabot.com/lodash/lodash/issues/4515|#4515>) • <https://github.com/lodash/lodash/commit/94c3a8133cb4fcdb50db72b4fd14dd884b195cd5|`94c3a81`> Document matches* shorthands for over* methods (<https://github-redirect.dependabot.com/lodash/lodash/issues/4510|#4510>) (<https://github-redirect.dependabot.com/lodash/lodash/issues/4514|#4514>) • Additional commits viewable in <https://github.com/lodash/lodash/compare/4.17.15...4.17.19|compare view> Maintainer changes This version was pushed to npm by <https://www.npmjs.com/~mathias|mathias>, a new releaser for lodash since your current version. <https://help.github.com/articles/configuring-automated-security-fixes|Dependabot compatibility score> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. * * * Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: • `@dependabot rebase` will rebase this PR • `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it • `@dependabot merge` will merge this PR after your CI passes on it • `@dependabot squash and merge` will squash and merge this PR after your CI passes on it • `@dependabot cancel merge` will cancel a previously requested merge and block automerging • `@dependabot reopen` will reopen this PR if it is closed • `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually • `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) • `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) • `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) • `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language • `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language • `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language • `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the <https://github.com/cofacts/rumors-site/network/alerts|Security Alerts page>.
#293 Update dependency lodash to v4.17.19 [SECURITY]
This PR contains the following updates: *GitHub Vulnerability Alerts* *<https://www.npmjs.com/advisories/1523|GHSA-p6mc-m468-83gw>* Versions of lodash prior to 4.17.19 are vulnerable to Prototype Pollution. The function zipObjectDeep allows a malicious user to modify the prototype of Object if the property identifiers are user-supplied. Being affected by this issue requires zipping objects based on user-provided property arrays. This vulnerability causes the addition or modification of an existing property that will exist on all objects and may lead to Denial of Service or Code Execution under specific circumstances. * * * *Release Notes* lodash/lodash *<https://togithub.com/lodash/lodash/compare/4.17.15...4.17.16|`v4.17.16`>* <https://togithub.com/lodash/lodash/compare/4.17.15...4.17.16|Compare Source> * * * *Renovate configuration* :date: *Schedule*: "" (UTC). :vertical_traffic_light: *Automerge*: Disabled by config. Please merge this manually once you are satisfied. :recycle: *Rebasing*: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: *Ignore*: Close this PR and you won't be reminded about this update again. * * * ☐ If you want to rebase/retry this PR, check this box * * * This PR has been generated by <https://renovate.whitesourcesoftware.com|WhiteSource Renovate>. View repository job log <https://app.renovatebot.com/dashboard#cofacts/rumors-site|here>.
Review on #201 Feature/163 insert data
Thanks for the fix, LGTM! I think we are ready to merge ~~
#12 Bump lodash from 4.17.10 to 4.17.19
Bumps <https://github.com/lodash/lodash|lodash> from 4.17.10 to 4.17.19. Release notes _Sourced from <https://github.com/lodash/lodash/releases|lodash's releases>._ > *4.17.16* Commits • <https://github.com/lodash/lodash/commit/d7fbc52ee0466a6d248f047b5d5c3e6d1e099056|`d7fbc52`> Bump to v4.17.19 • <https://github.com/lodash/lodash/commit/2e1c0f22f425e9c013815b2cd7c2ebd51f49a8d6|`2e1c0f2`> Add npm-package • <https://github.com/lodash/lodash/commit/1b6c282299f4e0271f932b466c67f0f822aa308e|`1b6c282`> Bump to v4.17.18 • <https://github.com/lodash/lodash/commit/a370ac81408de2da77a82b3c4b61a01a3b9c2fac|`a370ac8`> Bump to v4.17.17 • <https://github.com/lodash/lodash/commit/1144918f3578a84fcc4986da9b806e63a6175cbb|`1144918`> Rebuild lodash and docs • <https://github.com/lodash/lodash/commit/3a3b0fd339c2109563f7e8167dc95265ed82ef3e|`3a3b0fd`> Bump to v4.17.16 • <https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12|`c84fe82`> fix(zipObjectDeep): prototype pollution (<https://github-redirect.dependabot.com/lodash/lodash/issues/4759|#4759>) • <https://github.com/lodash/lodash/commit/e7b28ea6cb17b4ca021e7c9d66218c8c89782f32|`e7b28ea`> Sanitize sourceURL so it cannot affect evaled code (<https://github-redirect.dependabot.com/lodash/lodash/issues/4518|#4518>) • <https://github.com/lodash/lodash/commit/0cec225778d4ac26c2bac95031ecc92a94f08bbb|`0cec225`> Fix lodash.isEqual for circular references (<https://github-redirect.dependabot.com/lodash/lodash/issues/4320|#4320>) (<https://github-redirect.dependabot.com/lodash/lodash/issues/4515|#4515>) • <https://github.com/lodash/lodash/commit/94c3a8133cb4fcdb50db72b4fd14dd884b195cd5|`94c3a81`> Document matches* shorthands for over* methods (<https://github-redirect.dependabot.com/lodash/lodash/issues/4510|#4510>) (<https://github-redirect.dependabot.com/lodash/lodash/issues/4514|#4514>) • Additional commits viewable in <https://github.com/lodash/lodash/compare/4.17.10...4.17.19|compare view> Maintainer changes This version was pushed to npm by <https://www.npmjs.com/~mathias|mathias>, a new releaser for lodash since your current version. <https://help.github.com/articles/configuring-automated-security-fixes|Dependabot compatibility score> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. * * * Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: • `@dependabot rebase` will rebase this PR • `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it • `@dependabot merge` will merge this PR after your CI passes on it • `@dependabot squash and merge` will squash and merge this PR after your CI passes on it • `@dependabot cancel merge` will cancel a previously requested merge and block automerging • `@dependabot reopen` will reopen this PR if it is closed • `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually • `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) • `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) • `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) • `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language • `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language • `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language • `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the <https://github.com/cofacts/rumors-fb-bot/network/alerts|Security Alerts page>.
facebook.com
【LIFF Header 新功能】 於七月初提到的 LIFF Header 新功能今日已正式推出囉! 以下再次整理提供給大家更新內容: :point_right: 於原本頁面左上角 LINE Login chanel 的圖示將會隱藏 :point_right: 分享(Share)按鈕:按下後會分享、重整的選項(僅支援 LIFF Full size) - 分享:可將目前頁面透過 LINE Message 分享給其他用戶 -...
Comment on #190 LIFF trap source should guide user to other fact checkers
It's not a bug. This case is `ASKING_REPLY_REQUEST_REASON` state that means the article was already submitted.
Comment on #190 LIFF trap source should guide user to other fact checkers
I see, in that case the trap options like "我在 LINE 外頭看到的" should be hidden from the LIFF. If we can ensure the trap options are hidden, we can close the issue.
#210 Fix Issue 191 Error: user doesn't grant required permissions yet
Fixes <https://github.com/cofacts/rumors-line-bot/issues/191|#191>
Comment on #210 Fix Issue 191 Error: user doesn't grant required permissions yet
*Pull Request Test Coverage Report for <https://coveralls.io/builds/32171890|Build 1040>* • *1* of *8* *(12.5%)* changed or added relevant lines in *1* file are covered. • No unchanged relevant lines lost coverage. • Overall coverage decreased (*-0.8%*) to *79.695%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
Google Data Studio
Google Data Studio turns your data into informative dashboards and reports that are easy to read, easy to share, and fully customizable.
#211 Fix error cannot read property 'sessionId' of undefined
Fixes <https://github.com/cofacts/rumors-line-bot/issues/192|#192> It’s because default reply `context` object doesn’t have `data` property, when the next message comes in, getting `context.data.sessionId` will have such error.
Comment on #211 Fix error cannot read property 'sessionId' of undefined
*Pull Request Test Coverage Report for <https://coveralls.io/builds/32181129|Build 1044>* • *0* of *0* changed or added relevant lines in *0* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage remained the same at *80.521%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
Comment on #211 Fix error cannot read property 'sessionId' of undefined
<https://github.com/nonumpa|@nonumpa> Nice catch! Thanks for debugging. I think we can have an unit test that reproduces the case when default reply is used. Another thing is, it seems that I cannot reproduce the bug on LINE -- sending sticker message triggers the default reply, but sending further message does not crash the chatbot. May I know the correct steps to reproduce <https://github.com/cofacts/rumors-line-bot/issues/192|#192> ? In this way we can verify the bug is really fixed within the chatbot.
Comment on #211 Fix error cannot read property 'sessionId' of undefined
Oh, the next message should be a postback, only postback messages will get `context.data.sessionId`.
Comment on #211 Fix error cannot read property 'sessionId' of undefined
> Oh, the next message should be a postback, only postback messages will get context.data.sessionId. Thanks! So the reproduction step is clear now. 1. Send any text that shows a button (ex: `1234`) 2. Send a sticker and get "I cannot understand messages ..." 3. Click the previously shown button I think we can have a snapshot test for the default reply (probably using sticker message as mock input) and we are good to go.
Review on #210 Fix Issue 191 Error: user doesn't grant required permissions yet
LGTM! Just curious, <https://developers.line.biz/en/reference/liff/#liff-errors|the documentation> actually lists many LIFF error codes that is in strings. So only 403 is used in practice?
Comment on #210 Fix Issue 191 Error: user doesn't grant required permissions yet
The document says that 403 is associated with authorization error. Actually I directly calls liff.sendMessages on desktop, the error message is not the same as the one on mobile (`user doesn't grant required permissions yet`). Since we've told user to use mobile version, dunno if we need also check the error message to match the condition precisely. Another thing is `LiffError` collects all errors together, I don't know which API will return `403`, which will return `UNAUTHORIZED`.
Comment on #210 Fix Issue 191 Error: user doesn't grant required permissions yet
Let's merge it first and see if we need to handle other errors in the future.
Comment on #211 Fix error cannot read property 'sessionId' of undefined
Nit: when invoking `toMatchSnapshot` multiple times in one `it` test, we can pass in snapshot names to make snapshots easier to read.
Review on #211 Fix error cannot read property 'sessionId' of undefined
LGTM! Thanks for the fix! Let's merge and see if <https://github.com/cofacts/rumors-line-bot/issues/192|#192> still happens.
Comment on #204 Feature/backtrack user
1. What does `USER_ID` do? I may have missed where it is used. 2. Since the backtrack will only be run once, I think we can just put a comment to indicate how to run this function instead of putting it in package.json. In reality we may be executing the script using `heroku exec`.
Comment on #204 Feature/backtrack user
Both branch in this if-else statement does exactly the same thing.
Comment on #206 Add google analytics to LIFF
Confirmed that the `LIFF` / `chooseArticle` event is working. Ready to review now. <https://user-images.githubusercontent.com/108608/88018062-87da9b00-cb59-11ea-993d-99db6f81f383.png|image>
Inputting this will break staging chatbot: ``` 📃 查看這篇的回應: <https://dev.cofacts.org/article/AV1vp0l4yCdS-nWhuc4e> ``` The error in console says: ``` { "message": "A message (messages[2]) in the request body is invalid", "details": [ { "message": "must be non-empty text", "property": "/contents/5/body/contents/0/text" }, { "message": "must be non-empty text", "property": "/contents/6/body/contents/0/text" }, { "message": "must be non-empty text", "property": "/contents/7/body/contents/0/text" } ] } ``` This is because there are some replies with empty text (probably caused by a previous bug.) The reply sending mechanism should prevent empty text from being sent as an option.
Comment on #204 Feature/backtrack user
1. Use in rumors-line-bot-log-parser to show userId, because we hide the userId by default <https://github.com/cofacts/rumors-line-bot-log-parser/blob/5446ec86976e4c55f24fd355fe595a45da5f31e2/index.js#L93|https://github.com/cofacts/rumors-line-bot-log-parser/blob/5446ec86976e4c55f24fd355fe595a45da5f31e2/index.js#L93> 2. okok
Comment on #204 Feature/backtrack user
Haha I just change the function name, not seeing this
g0v.hackmd.io
Review on #204 Feature/backtrack user
Looks great, thanks a million!
Comment on #281 Search bar input should span multiple rows
From discussions in <https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E6%9C%AA%E7%AB%9F%E9%A0%85%E7%9B%AE|https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E6%9C%AA%E7%AB%9F%E9%A0%85%E7%9B%AE> even though we can support multi-line, "enter" should still trigger search instead of new lines
#294 Send upvote / downvote at the same time button is pressed
From: <https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E6%9C%AA%E7%AB%9F%E9%A0%85%E7%9B%AE|https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E6%9C%AA%E7%AB%9F%E9%A0%85%E7%9B%AE> *As-is* <https://user-images.githubusercontent.com/108608/88136711-70b0b180-cc1c-11ea-999b-7ec356b5dbae.png|image> • Clicking upvote / downvote shows reason dialog. • Upvote / downvote are sent along with its reason after clicking "Send". *To-be* • Upvote / downvote (without reason) is submitted as soon as the upvote / button button is clicked. • Clicking upvote / downvote still shows reason dialog, but with different prompt: "Thank you for the feedback." + "Do you have anything to add?" / "Why do you think it is not useful?" • "Send" --> "Close" when no content, "Send" when inputted something • After clicking "Send", the vote is submitted again, this time with reason.
#213 Improve wording in reason feedback dialog
*As-is* From <https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E5%9B%9E%E6%87%89%E3%80%8C%E6%B2%92%E6%9C%89%E3%80%8D%E7%9A%84%E6%AD%A3%E8%A9%95|https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w?both#%E5%9B%9E%E6%87%89%E3%80%8C%E6%B2%92%E6%9C%89%E3%80%8D%E7%9A%84%E6%AD%A3%E8%A9%95> > 看來是因為我們在使用者回報一個回應有用時,會這樣問使用者: > <https://camo.githubusercontent.com/a18cb9ea3680766154d5b90b67e931aa80460493/68747470733a2f2f73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6730762d6861636b6d642d696d616765732f75706c6f6164732f75706c6f61645f32613165663531623633356238343966393664663836376533646462383364362e706e67|https://camo.githubusercontent.com/a18cb9ea3680766154d5b90b67e931aa80460493/68747470733a2f2f73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6730762d6861636b6d642d696d616765732f75706c6f6164732f75706c6f61645f32613165663531623633356238343966393664663836376533646462383364362e706e67> > 這個提問導致使用者輸入「沒有」然後送出。但在 Cofacts 網站上,就會看到有一堆人 upvote 然後又表示「沒有」,有點沒頭沒尾。 > <https://user-images.githubusercontent.com/108608/88138295-f5e99580-cc1f-11ea-9eb9-9aa435699fbf.png|image> > [name=MrOrz] > > 可以用 place holder 寫「沒有其他意見」之類的,這樣使用者應該會直接按送出? > [name=stimim] *To-be* Change the wording so that: • The dialog still asks "Do you have anything to add" • Change the placeholder of text area to "Nothing to add". • If the dialog is empty, change text of the button to "Close"; reads "Submit" only after textarea has content
#295 UX improvements of search function in desktop editor
*As-is* <https://user-images.githubusercontent.com/108608/88139136-adcb7280-cc21-11ea-8649-eafd0b04d3e1.png|image> • 搜尋框很不明顯 • 搜尋結果無法拉大,列表呈現在很小的地方 • 搜尋的當下沒有 loading state • Enter 搜尋不直觀,而且 iOS 上 enter 會顯示「換行」 • 有時候其實只是想看一看搜尋結果,按搜尋旁邊的 X 關掉實在太不直觀 • iOS 上點按「Add this reply to my reply」會直接送出回應! *To-be* Figma: <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=908%3A91|https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=908%3A91> <https://user-images.githubusercontent.com/108608/88139207-cdfb3180-cc21-11ea-94f4-1d34a501ee7e.png|image> • 搜尋框加上「參考過往回應」的 placeholder • 使理由與來源的 input 能垂直拉大(水平方向則固定) • 搜尋時加上 loading indicator • 修正 iOS 點按「Add this reply to my reply」送出的問題
g0v.hackmd.io
steamcommunity.com
Review on #206 Add google analytics to LIFF
LGTM!
Comment on #206 Add google analytics to LIFF
According to <https://g0v.hackmd.io/OC7BneJ3TEGJHge1hWV-0w#Cofacts-Next-%E8%BF%BD%E8%B9%A4|discussion>, we don't open articles page via LINE Notify anymore.
Comment on #170 Support RSS for all lists on website
Done in <https://github.com/cofacts/rumors-site/pull/210|#210>, will continue tracking in <https://github.com/cofacts/rumors-site/issues/262|#262>
Comment on #190 LIFF trap source should guide user to other fact checkers
As discussed on Slack in 7/22 we plan to remove the step that asks source. Closing this issue.
g0v.hackmd.io
#186 Cannot login to local dev server
*How to Reproduce* • `npm run dev` to start a dev server. • Open <http://localhost:3000/article/1fi7dla9wtwjn|http://localhost:3000/article/1fi7dla9wtwjn> with Google Chrome or Safari. • Click the `Login` button in top right corner. • You should be redirected to <https://cofacts.hacktabl.org/article/1fi7dla9wtwjn|https://cofacts.hacktabl.org/article/1fi7dla9wtwjn> • Go back to <http://localhost:3000/article/1fi7dla9wtwjn|http://localhost:3000/article/1fi7dla9wtwjn> • *What is expected*: You should be logged in, and your account should be shown in top right corner. • *What actually happened*: Not logged in, `Login` button is still shown in top right corner. *Additional Info* In both browser, there is no cookie from cofacts domain. *Google Chrome* Found the following message in developer console: ``` A cookie associated with a cross-site resource at <http://cofacts-api.hacktabl.org/> was set without the `SameSite` attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <https://www.chromestatus.com/feature/5088147346030592> and <https://www.chromestatus.com/feature/5633521622188032>. ``` *Safari* Found the following message in javascript console: ``` [Error] The source list for Content Security Policy directive 'script-src' contains an invalid source: ''report-sample''. It will be ignored. ```
Comment on #186 Cannot login to local dev server
Working on a <https://github.com/cofacts/rumors-api/tree/samesite|branch> to mitigate this, but blocked by `secure` detection issue: • <https://github.com/pillarjs/cookies/issues/51|pillarjs/cookies#51> • <https://github.com/koajs/koa/issues/974|koajs/koa#974>
#296 Add line breaks to category description
As discussed in 0722, we are going to let collaborators try out our category UI in the hackathon tomorrow. In order to properly display the <https://g0v.hackmd.io/D4KfdMRWS-OmCKd-Fhli2Q|category definition>, we add line breaks to make descriptions more readable. <https://user-images.githubusercontent.com/108608/88364059-70e3b500-cdb4-11ea-825b-0c72da281ce7.png|image>
#297 Add search icon, placeholder, and enablef height adjustment
Done 搜尋框加上「參考過往回應」的 placeholder 使理由與來源的 input 能垂直拉大 增加搜尋圖示提供搜尋功能,而不是只能用 Enter TODOs 使理由與來源的 input 水平方向則固定 搜尋時加上 loading indicator 修正 iOS 點按「Add this reply to my reply」送出的問題
#298 Fix dev "cannot invoke map of undefined" bug
ArticleInfo should query for articleReplies as it is using articleReply data. *Before* <https://user-images.githubusercontent.com/108608/88452851-9b0ca400-ce94-11ea-9b1f-15e8fdf0547e.png|image> *After* Detail page can load without problem *Analysis* `<ArticleInfo>` in `ArticleDetail` page actually uses `articleReplies` field. However, It's not declared in its fragment, thus `articleReplies` fields are not populated properly in detail page. This PR adds the field in loading sequence so that the field exists no matter where `<ArticleInfo>` is used.
Comment on #297 Add search icon, placeholder, and enablef height adjustment
Thank you for locating the root cause! After trying the UI out, I found that `flex: 1` is actually required on mobile to enlarge the textarea. I suggest leaving `flex: 1` as-is and adding the following in `[theme.breakpoints.up('md')]`: ``` flex: 'none', // Disable flex so that user can enlarge textarea by themselves minHeight: 144, ```
Comment on #297 Add search icon, placeholder, and enablef height adjustment
Thanks for your review. I had applied the suggestions.
Review on #297 Add search icon, placeholder, and enablef height adjustment
LGTM! Thank you <https://github.com/AJua|@AJua> !
#299 Prevent search input from being hided
Fix issue <https://github.com/cofacts/rumors-site/issues/280|#280>
Comment on #299 Prevent search input from being hided
Personally I would prefer `onExpanded` or `onToggle` because this is the scenario that a child component component notifies parent component about something happening. Parent component can determine how to react to such event. ``` <GlobalSearch onExpand={expanded => setDisplayLogo(!expanded)} /> ```
Comment on #299 Prevent search input from being hided
I've refactor the relation between the parent and the child component so that parent listen to child's change rather then the child change the parent directly
Review on #299 Prevent search input from being hided
It is looking good. Thank you very much!
#187 Load more reply request at once
This fixes <https://github.com/cofacts/rumors-api/issues/164|#164> Test TBD
Figma
Created with Figma
#298 Fix dev "cannot invoke map of undefined" bug
ArticleInfo should query for articleReplies as it is using articleReply data. *Before* Staging: <https://user-images.githubusercontent.com/108608/88452851-9b0ca400-ce94-11ea-9b1f-15e8fdf0547e.png|image> Localhost: <https://user-images.githubusercontent.com/108608/88452996-c9d74a00-ce95-11ea-971f-dade9b3dfe1c.png|image> *After* Detail page can load without problem *Analysis* `<ArticleInfo>` in `ArticleDetail` page actually uses `articleReplies` field. However, It's not declared in its fragment, thus `articleReplies` fields are not populated properly in detail page. This PR adds the field in loading sequence so that the field exists no matter where `<ArticleInfo>` is used.
Review on #207 Feature/165 cron notify
LGTM! Thanks for the fix. Added two nice-to-have comments below.
Comment on #207 Feature/165 cron notify
We can use === for numeric comparison (Also in L89)
Comment on #207 Feature/165 cron notify
When using `babel-node`, we should be able to run from `src/script` directly, or there may be error when it's not built yet
Comment on #206 Add google analytics to LIFF
Nice catch! Thanks.
Comment on #187 Load more reply request at once
<https://coveralls.io/builds/32335154|Coverage Status> Coverage increased (+0.02%) to 86.849% when pulling *<https://github.com/cofacts/rumors-api/commit/ed6b99aa581ea3f19f2f6125dee119ae53fedd09|ed6b99a> on replyrequests* into *<https://github.com/cofacts/rumors-api/commit/236152b3af550ddebce0b110e3458bf3941c84dc|236152b> on master*.
Comment on #207 Feature/165 cron notify
Sorry, I forgot to change the script path..
Review on #207 Feature/165 cron notify
Thanks for the fix :pray:
#300 Add back progress bar and info in menu
*As-is* *Desktop* <https://user-images.githubusercontent.com/108608/88622890-4f493d00-d0d6-11ea-8f80-a570689c0739.png|image> *Mobile* <https://user-images.githubusercontent.com/108608/88622952-6851ee00-d0d6-11ea-95bf-32535bc8ee75.png|image> *To-be* • Add progress bar in desktop menu • Add "仍須 N 篇闢謠升級" / "N replies left to next level" (無需如圖般左右對齊,直接置中對齊也可以) • Clicking name should allow user to change their name using <https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt|`window.prompt()`>. *Desktop* <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=138%3A25|https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=138%3A25> <https://user-images.githubusercontent.com/108608/88622868-448ea800-d0d6-11ea-9281-c394108c105c.png|image> *Mobile* <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=235%3A666|https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=235%3A666> <https://user-images.githubusercontent.com/108608/88622996-861f5300-d0d6-11ea-8316-89c13b28891a.png|image>
#301 Introduce <Infos> and <TimeInfo> for as a flexible info display
This PR implements `<Infos>` and `<TimeInfo>` and reuse them in `<ArticleInfo>` and `<ReplyInfo>` temporarily. Actually, in the mockup the info lines are very diverse and has different info to display in each place. In the future, `<ArticleInfo>` and `<ReplyInfo>` will be removed, and `<Infos>` and `<TimeInfo>` will be directly used in article items instead. *Storybook* <https://user-images.githubusercontent.com/108608/88764598-cef30c80-d1a7-11ea-8d7e-cda42676579d.gif|info optional> <https://user-images.githubusercontent.com/108608/88764605-d0243980-d1a7-11ea-8dcf-78bbdc20ef3f.gif|TimeINfo> *Reply list* <https://user-images.githubusercontent.com/108608/88764230-2644ad00-d1a7-11ea-92a4-6721f7ac23b1.png|image> *Article detail* <https://user-images.githubusercontent.com/108608/88764283-42484e80-d1a7-11ea-8c53-f85812de3238.png|image>
Credibility Coalition
Welcome to CredCatalog. This is an effort to compile projects and initiatives that aim to improve information quality. We are collecting information on fact-checking groups, technology tools, academic research institutions and so much more. Explore our growing list of entries by geography, language, funders and solutions categories.
Comment on #301 Introduce <Infos> and <TimeInfo> for as a flexible info display
`color` should be `inherit`
#302 Bump elliptic from 6.5.1 to 6.5.3
Bumps <https://github.com/indutny/elliptic|elliptic> from 6.5.1 to 6.5.3. Commits • <https://github.com/indutny/elliptic/commit/8647803dc3d90506aa03021737f7b061ba959ae1|`8647803`> 6.5.3 • <https://github.com/indutny/elliptic/commit/856fe4d99fe7b6200556e6400b3bf585b1721bec|`856fe4d`> signature: prevent malleability and overflows • <https://github.com/indutny/elliptic/commit/60489415e545efdfd3010ae74b9726facbf08ca8|`6048941`> 6.5.2 • <https://github.com/indutny/elliptic/commit/9984964457c9f8a63b91b01ea103260417eca237|`9984964`> package: bump dependencies • <https://github.com/indutny/elliptic/commit/ec735edde187a43693197f6fa3667ceade751a3a|`ec735ed`> utils: leak less information in `getNAF()` • See full diff in <https://github.com/indutny/elliptic/compare/v6.5.1...v6.5.3|compare view> <https://help.github.com/articles/configuring-automated-security-fixes|Dependabot compatibility score> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. * * * Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: • `@dependabot rebase` will rebase this PR • `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it • `@dependabot merge` will merge this PR after your CI passes on it • `@dependabot squash and merge` will squash and merge this PR after your CI passes on it • `@dependabot cancel merge` will cancel a previously requested merge and block automerging • `@dependabot reopen` will reopen this PR if it is closed • `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually • `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) • `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) • `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) • `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language • `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language • `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language • `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the <https://github.com/cofacts/rumors-site/network/alerts|Security Alerts page>.
#303 Fix reply search release blocker
Fix <https://g0v.hackmd.io/r3NK7xssSwCNPFxthlw7tA#%E2%9B%94%EF%B8%8F-Release-Blockers1|20200729 release blocker>. *Screenshot* <https://user-images.githubusercontent.com/108608/88882177-ef809c80-d263-11ea-87c4-93db092bb067.png|image>
#188 script to fetch google analytics stats
There's an edge case when the cron job runs at midnight, the first cron job of the day should also update the value for yesterday ie. if the last cron job of the day runs at 23:00, and the next one runs at 0:00, any activities between the last cron job till midnight won't be accounted for. I'm not sure if this should be handled by the script itself (i.e. check if current time is near midnight), or just set another cron job to run it once a day. The former is kinda weird and needs to watch out for the timezone setting of the server and GA. The later has a catch, that is, to run the script for any dates other than today would be ran in migration setting, which would use url path to determine doc id instead of content grouping. It shouldn't be that big of a day since there aren't that many entries per day...
Comment on #188 script to fetch google analytics stats
<https://coveralls.io/builds/32423923|Coverage Status> Coverage increased (+0.8%) to 87.593% when pulling *<https://github.com/cofacts/rumors-api/commit/7dc45064a84a9ae4e129d45dc77d1ff44270ae23|7dc4506> on fetchGA* into *<https://github.com/cofacts/rumors-api/commit/236152b3af550ddebce0b110e3458bf3941c84dc|236152b> on master*.
Figma
Cofacts website (MrOrz's copy)
Created with Figma
Fixes <https://github.com/cofacts/rumors-site/issues/262|#262> feedUrl cannot handle options passed by ArticlePageLayout, so put option into query.