cofacts / rumors-api

GraphQL API server for clients like rumors-site and rumors-line-bot
https://api.cofacts.tw
MIT License
109 stars 26 forks source link

Fix ArticleType's attachmentUrl and CreateOrUpdateArticleReplyFeedback's articleReplyUserId #286

Closed MrOrz closed 2 years ago

MrOrz commented 2 years ago

Bugfix 1: ArticleType's attachmentUrl field throws error when attachmentHash is empty

The bug was introduced in #284 .

Querying ArticleType's attachmentUrl will trigger Cannot read properties of undefined (reading 'split') error.

圖片

The root cause is that for non-image articles, attachmentHash is null. However, we send null to MediaManager to generate URL for attachmentUrl field.

This PR:

Bugfix 2: CreateOrUpdateArticleReplyFeedback records wrong articleReplyUserId on feedback doc

In the image below, the article reply feedback for article 2889dua0k41ro and reply sKR1hn0BnX5-aOa4S29I has its articleReplyUserId being AWA_PbObyCdS-nWhukq-; however, according to the article data, the article reply is actually created by user AVqVwjqQyrDaTqlmmp_a. 圖片

This PR

This PR is deployed to staging on 6/25.

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.01%) to 87.544% when pulling b2c3854407ed2e3eb07f4bb74ef70c3d6be409e5 on fix-url-resolver into 6540c6cbb03e0166a125820344a6e8da5e744d61 on master.