cofacts

Month: 2020-03

2020-03-01

yanglin 17:05:12
@lucien @stbb1025 想請問一下
所以按照 figma 設計,未來訊息會分成三個頁面
然後回應就直接帶在訊息下面可以收合,不再有獨立頁面
是這樣子嗎?
https://www.figma.com/file/5qegqv1g0fxCYkzNz3jVA6/%5BWireframe%5D-Need-to-Review-Page?node-id=0%3A1

Figma

[Wireframe] Need to Review Page

Created with Figma

缺 RSS 訂閱按鈕~
rss 訂閱鈕應該好處理
時間的 filter 是不是要額外加?
嗯 API 目前還沒有,要加
嗨嗨,不是的
每個列表的可疑訊息點進去仍然會有詳情頁
目前只有最新查核頁才有帶回覆
熱門訊息那邊,我還要確定一下定義
熱門訊息是啥呀
用 LINE bot analytics 的嗎(現在沒有)
Eric Chen 18:16:17
@iforests has joined the channel
maxjkfc 21:22:41
@maxjkfc has joined the channel
zoe.lee 23:55:25
@zoe.lee has joined the channel

2020-03-02

Wei 00:29:41
@a65162 has joined the channel
tw4our 12:35:33
@tw4our has joined the channel
kay830123 20:46:01
@kay830123 has joined the channel

2020-03-03

mrorz 02:03:21
Rollbar 又要滿了
最近最熱門兩個 error 是
https://github.com/cofacts/rumors-site/issues/209
https://github.com/cofacts/rumors-site/issues/227 (這在今晚突然大爆發,一定是有爬蟲在爬網站囧)

GitHub

t: GraphQL error: userId is not set via query string. · Issue #209 · cofacts/rumors-site

View details in Rollbar: <https://rollbar.com/mrorz/rumors-site/items/62/> t: userId is not set via query string. File &amp;quot;https://cofacts.g0v.tw/_next/static/chunks/commons.3d6e3726d3a6a9caf962.js...

GitHub

GraphQL error: Both appId and userId must be specified at once · Issue #227 · cofacts/rumors-site

View details in Rollbar: <https://rollbar.com/mrorz/rumors-site/items/105/> Error: GraphQL error: fromUserOfArticleId does not match any existing articles File &amp;quot;/srv/www/node_modules/apollo-clie...

這是怎樣囧
他直接衝 982 occurences
我現在 quota 剩 200
下次 reset 是 3/19
WTF
我先把 production 中文與英文的 rollbar 都拔掉了(rollbar token 從 docker-compose 裡 comment 掉之後重啟)

等我把上面兩個 bug 修完之後再開⋯⋯
mrorz 02:04:39
最近只剩下網站的 error 了
非常感謝 @acerxp511 消滅 LINE bot 的 error,剩下的網站的 bug 都是我以前造的孽嗚嗚嗚嗚
1
yanglin 09:39:07
@lucien @stbb1025 前端頁面感覺可能需要針對行動裝置做優化?
@mrorz 所以我先做 time range API 嗎?
還有這週什麼時間可以 cowork 呢?
@yanglin5689446 周四週五我會在 workis 唷

其實目前還是蠻需要一個能呈現最新回應的 Article list ( https://github.com/cofacts/rumors-site/issues/212 ) 。如果設計還沒好的話,time range API ( https://github.com/cofacts/rumors-api/issues/148 ) 是很不錯的方向。
那我先做一個簡單的把最新回應接在訊息下面的 UI
之後等設計出來再優化?
行動裝置的部分週三可以給大家看新進度唷
我最近在用 RSS,覺得有信件寄到自己信箱蠻有用的,所以昨天在處理這個 https://github.com/cofacts/rumors-site/issues/225
今明兩天發 PR;
不過我今天中午應該會先處理凌晨的時候提的兩個常發生的 Bug。
是說你們禮拜三的開會都在哪哇
我可以參與嗎?
歡迎歡迎
8:30pm 一樣在 Workis 唷

過去的會議記錄請見 https://g0v.hackmd.io/-OLr4hRoQBOjtMjo947X4Q
它是個 linked list~
明明就是8點QQ
話說
> 可能需要針對行動裝置做優化
我覺得實作的時候可能直接從 mobile-first 的思維來做會比較好,也就是所有的 style 與 component 都是預設 for mobile,desktop 版本放在 condition / media query 裏頭

一方面是這樣 mobile 效能會比較好,符合我們的使用數據(大多數 mobile)
另一方面是邏輯也會比較單純,不會有些判斷式在判斷是 mobile、有些在判斷是 desktop。
Sure~但其實可以在實作的時候同時考量😆
👍
mrorz 21:11:19
說到 time range API
https://github.com/cofacts/rumors-api/issues/148 裡面只提到要提供的 operator,但沒有提到 value 的部分。

其實 elasticsearch range query 還支援 `now/d` (會自動 round 到今天的開始或結束) 與 `now-7d` (七天內) 等 relative time range
這個在做 RSS 訂閱的時候非常有用,因為我會想訂閱「最近 7 天」送出且有某關鍵字的訊息列表
所以 API 方面,希望 value 可以是這種形態(直接用字串?)

GitHub

Provide date range filter for ListArticles and ListReplies · Issue #148 · cofacts/rumors-api

From 20200212 meeting note, it would be great if we can provide date range search on createdAt for articles and replies, lastRequestedAt or having article reply createdAt for articles. To achieve t...

👍 1
mrorz 22:59:09
然後有空也可以看看 PR 唷
https://github.com/cofacts/rumors-site/pull/228

GitHub

Show login error and don't send them to Rollbar by MrOrz · Pull Request #228 · cofacts/rumors-site

Fixes #209 Capture auth error emitted by rumors-api and display alert() Auth error still produces a rejected promise (so that success callbacks are not invoked), but it will no longer trigger Roll...

mrorz 23:54:29
@bil 3/14 線上大松
我們在 workis 可以自己訂肯德基嗎 XDD
workis最近是胖老爹
但 KFC 比較棒
訂那個都是腿的
那揪松要訂起家雞(雲端大松演變成炸雞 battle)
我要穿小仙女送公文然後吃雞腿喝牛奶、欸有烤雞腿嗎迷迭香
好呀可以

2020-03-04

Yiling 06:28:14
@yiling.cheng010 has joined the channel
Chin 09:59:58
@greeting.to.chin has joined the channel
yanglin 13:12:08
先做了一個陽春的可以看到最新回覆的介面
只有 filter 選 most recently replied 的時候才會顯示
不過我用右圖的 fragment query 去拿資料的時候
神奇的事全部都是拿到同一筆 articleReply?
數量好像是對的但內容都是同一筆
有點神奇
截圖 2020-03-04 下午1.09.24.png
截圖 2020-03-04 下午1.10.01.png
拿 `articleReplies` 的時候
底下加拿 `articleId` 與 `replyId` 呢?

我猜是 normalized cache 抓錯 instance
有了
感謝感謝
我們在 custom ID mapper 有指定 `ArticleReply` 的 id 是 `articleId` + `replyId`
https://github.com/cofacts/rumors-site/blob/dev/lib/apollo.js#L21-L22
這種真的是沒踩過不會知道囧
這邊有 apollo-client 預設的 cache 的行為
https://www.apollographql.com/docs/react/caching/cache-configuration/#data-normalization

都沒圖就是惹
是說我覺得 filter 選 all (所有訊息) 也可以顯示 latest reply~? 就是有回應的就顯示,沒回應的就不顯示
現在是 order by most recent relied 的時候會顯示
fly 17:05:11
https://taiwan.googleblog.com/2020/03/detectingfakeimergy.html

Google台灣 - 官方部落格

事實查核新工具:協助亞洲各地區新聞編輯室偵測假圖片

面對快速散播的不實資訊,如何從中去蕪存菁、辨別正確內容,儼然成為新聞記者和事實查核人員的巨大挑戰。可怕的是,不實資訊無所不在,文字還只是其中一部分, 那些像病毒般流傳的圖片 及 網路爆紅梗圖 ,也大量充斥在我們的動態消息和即時通訊,而這些內容往往都有斷章取義或造假的可能性。在...

1
Swim 20:02:47
@poesiapeng has joined the channel
delightfullychaotic 20:05:04
@mrorz 這邊有熱情的台南鄉親 發現機器人的 Bug
簡單來說就是有超過一篇回應的情況下,按了一篇看完,無法按其他篇
Swim 20:05:11
Image from iOS
Hi @poesiapeng, 剛才 deploy 了最新版的 chatbot。現在看完一篇回應之後應該可以接另一篇囉!

不過,如果傳了新的訊息進來,前一則訊息的所有按鈕仍然會失效。

因為整個 chatbot 剛完成大改寫,所以最近可能會發現沒測到的 bug,還請大家多多幫忙回報 m(_ _)m

cc/ @delightfullychaotic 原討論串
@mrorz 剛剛測試了,確認可以點擊其他回應!辛苦了👍
不過剛剛我要點擊「是」回應是否有幫助的問題,卻跳出這個畫面,可是我是使用手機😅⋯⋯
Hmm 我是 Android 使用者,沒有遇到這件事情呢。

@poesiapeng 請問您是不是有開啟「在 Safari 開啟連結」功能呢

https://today.line.me/tw/article/%E6%96%B0%E5%A2%9E%EF%BC%8F+iOS%E7%89%88LINE+%E6%8F%90%E4%BE%9B%E7%94%A8Safari%E9%96%8B%E5%95%9F%E9%80%A3%E7%B5%90%E7%9A%84%E5%AF%A6%E9%A9%97%E5%8A%9F%E8%83%BD-nm9m0D
如果有的話,請把它關閉再試試看唷
確認可以打開囉!辛苦了
感謝您的測試,我們晚上 9:45 時剛上新版,應該是修好了~~
delightfullychaotic 20:05:28
就是我們可愛的正妹 @poesiapeng 非常感謝反應 ❤️
mrorz 20:09:42
感謝感謝,記錄在這裡囉 https://github.com/cofacts/rumors-line-bot/issues/49

GitHub

Postback buttons should be usable for the entire search session · Issue #49 · cofacts/rumors-line-bot

From the meeting note: The postback buttons for choosing articles and choosing replies should still be clickable after the user has chosen an article or chosen a reply. After the user forwarded us ...

2020-03-05

mrorz 01:10:33
Review 了 @acerxp511 的 PR 囉 https://github.com/cofacts/rumors-line-bot/pull/160

也請大家看看 RSS 的 PR:https://github.com/cofacts/rumors-site/pull/229

GitHub

Fix image message bug by nonumpa · Pull Request #160 · cofacts/rumors-line-bot

Fix image message bug, should only handle text.length &gt;= 3 Note : text.length &lt; 3 won&amp;#39;t be consider as new article sent in. Limit the number of image messages linebot can process simult...

GitHub

Fix RSS feed content-type, add replies in feed and adjust subscribe button by MrOrz · Pull Request #229 · cofacts/rumors-site

Currently on production site, the RSS feed link cannot be added to IFTTT and blogtrottr. blogtrottr has told me that the current Cofacts feed has invalid content-type header. This PR: adds a vali...

NCHC_AUG 07:32:10
@augchao.nchc has joined the channel
mrorz 15:12:39
@yanglin5689446 昨天的 PR 有一些 exception 麻煩幫 review
感謝感謝 https://github.com/cofacts/rumors-site/pull/231

GitHub

Handle when latestReply is undefined by MrOrz · Pull Request #231 · cofacts/rumors-site

Currently visiting article list will see 500 internal server error: The root cause is ArticleItem trying to read createAt on empty reply: cofacts-staging-zh_1_26a0c24950d3 | 2020-03-05 06:04 +00:0...

👌 1
ichieh 16:58:04
嗨我是揪松團的以婕,g0v 三月大松改為線上參與,因為知道專案們可能會揪實體小松,開了一個共筆彙整資料,歡迎大家持續補上自己專案的資訊和地點 😆:https://g0v.hackmd.io/@jothon/SktGdVAVU
mrorz 17:22:53
感謝以婕~
mrorz 17:23:31
新的 RSS 上 staging site 了,我做了一個 IFTTT Applet 可以把 Cofacts RSS 透過 LINE Notify 送進 LINE
https://ifttt.com/applets/djEHvum7

ifttt.com

傳送 Cofacts 更新到 LINE

傳送 Cofacts 更新到 LINE

太讚啦!!
有幾個限制
1. 每個 IFTTT 使用者,同一個 applet 只能 connect 一次;如果他要 subscribe 另一個 RSS feed,必須要自己從 https://ifttt.com/create 做一個
2. 使用者要自己把 LINE Notify 加入好友,然後要在 IFTTT 上用 LINE 登入 ( https://www.oxxostudio.tw/articles/201803/ifttt-line.html )
1 2
mrorz 17:42:08
其實另外一種做法是,我們這裡自己直接接 LINE notify,不走 IFTTT RSS -> LINE Notify。跟 LINE notify 整合,看起來就是啟動 Oauth flow 之後拿到使用者的 access token,然後我們就能用這個(不會過期的)access token 發 notification。notification 發給誰、發到哪個 channel,是使用者在被導向到 LINE 的時候自己寫的。

也就是說,每個 access token 都會是一個 subscription 紀錄。我們要把 access token 們記下來,然後自己決定什麼時候 notify 使用者。
mrorz 19:46:04
是說如果要實作 web notification
其實也可以用 web worker 實作一個定時讀 RSS(還有紀錄上次讀到哪)的機制
有新東西的時候進行 push notification
這樣也不用做 third-party integration
mrorz 20:15:00
之前按回應列表有時候會壞掉的 bug
在這裡會修好唷,請 review: https://github.com/cofacts/rumors-site/pull/232

GitHub

Fixes searchUserByArticleId and reply page error by MrOrz · Pull Request #232 · cofacts/rumors-site

Fixes #227 by Display error and handle null values properly in article list page ignore that specific error in Rollbar This PR also fixes #193 by properly handle null values in reply list page....

yc Lin 22:15:24
@lcdwpt has joined the channel

2020-03-06

mrorz 10:52:37
禮拜三的時候有聊過我把 polyfill 塞進 webpack bundle 這件事
( https://g0v.hackmd.io/-x5qyf_ER-mTiECYx0GX6g#Polyfill )

我剛才用 next-bundle-analyzer 測了一下,結果在這裡:
polyfill.png
不過左邊 commons.js (卡其色)裡也有 corejs-library QQ
很多
大概是 0.6 個 material-ui (?
mrorz 10:54:17
Parsed size (=minify 過、gzip 前) 多 93KB
這算很多嗎 XD
yanglin 11:05:17
整體來說不算很多
但是變大八倍這一點有點多 XD
mrorz 11:11:48
那我開張票放著好了
mrorz 11:13:30
這張票 merge 之後我就可以把 Rollbar 再打開囉
https://github.com/cofacts/rumors-site/pull/232

GitHub

Fixes searchUserByArticleId and reply page error by MrOrz · Pull Request #232 · cofacts/rumors-site

Fixes #227 by Display error and handle null values properly in article list page ignore that specific error in Rollbar This PR also fixes #193 by properly handle null values in reply list page....

isabelhou 21:04:17
Cofacts在314大松日會有實體坑嗎?有的話請填一下喔https://g0v.hackmd.io/dOt6002FTe2loy3Ncq6_7Q

g0v.hackmd.io

g0v Hackath38n 在家松實體坑共筆 - HackMD

2020-03-07

bil 00:13:31
有喔甜甜
dajing 17:21:49
@wer321011 has joined the channel

2020-03-09

mrorz 12:47:25
Cofacts production 硬碟滿了囧
我們有個 cronjob 每天會清掉 API 送進來問過之後就沒人用的 hyperlink scrap result
3/8 的時候有成功執行並且清除上萬個 hyperlink result

但 3/9 的時候不知道為什麼都沒成功
我先 `du` 看一下到底爆在哪
```root@debian:/home/docker/rumors-deploy# du -d 2 -h volumes/
4.0K volumes/certbot/renew-cron
8.0K volumes/certbot
4.0K volumes/db-sample
456K volumes/db-production/nodes-bkup
24K volumes/db-production/bkup
8.3G volumes/db-production/nodes
9.8G volumes/db-production
20K volumes/nginx/sites-enabled
28K volumes/nginx
4.0K volumes/db-staging
9.8G volumes/```
資料庫才 8.3 G
我整個系統是 160G 噎
```root@debian:/var/log# du -d 2 -h .
4.0K ./unattended-upgrades
2.1M ./letsencrypt
1.5G ./linode
44K ./exim4
12K ./fsck
92K ./apt
5.3G ./nginx
13M ./installer/cdebconf
13M ./installer
28K ./git-daemon
4.0K ./sysstat
4.0K ./ntpstats
6.9G .```
Log 是 6.9G
nginx log 看起來大,但是我有 logrotate 所以應該還 ok
`/var/lib/docker` 134G 呀 ._.
```root@debian:/var/lib# docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 27 7 7.903GB 5.63GB (71%)
Containers 7 6 5.344GB 151B (0%)
Local Volumes 122 0 45.4MB 45.4MB (100%)
Build Cache 0 0 0B 0B```
然後 docker system df 跟我說只有 5.63 GB
`/var/lib/docker ` 底下最大的是 containers
images 是 41G 等等再處理
```root@debian:/var/lib/docker# du -d 1 -h .
47M ./volumes
20K ./plugins
4.0K ./runtimes
20K ./builder
4.0K ./tmp
72K ./buildkit
63M ./image
41G ./devicemapper
104K ./network
4.0K ./swarm
4.0K ./trust
94G ./containers
268K ./containerd
134G .```
94G 的 container 裡
最大的是 94G 的、正在跑 elasticsearch 的 container @@
Google 找 elasticsearch container 佔空間的問題
https://stackoverflow.com/questions/59507037/elasticsearch-docker-container-taking-all-my-disk-space-cannot-find-where
有人說是資料亂存(但發問者跟我一樣是把整個 data 資料夾 bind mount)
有人說是 swap 問題
總之我先照著做
把 elasticsearch container restart 好了
只是這樣我 backup 要重設哎