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:
Returns null for attachmentUrl if attachmentHash is null
Introduces a test case that will fail if this PR is not implemented
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
Fixes the typo in the logic that wrongly grabs the first article reply's author as articleReplyUserId
Adjust unit test fixture to reproduce the bug and proof that it's fixed
Coverage increased (+0.01%) to 87.544% when pulling b2c3854407ed2e3eb07f4bb74ef70c3d6be409e5 on fix-url-resolver into 6540c6cbb03e0166a125820344a6e8da5e744d61 on master.
Bugfix 1: ArticleType's
attachmentUrl
field throws error whenattachmentHash
is emptyThe bug was introduced in #284 .
Querying
ArticleType
'sattachmentUrl
will triggerCannot read properties of undefined (reading 'split')
error.The root cause is that for non-image articles,
attachmentHash
is null. However, we sendnull
toMediaManager
to generate URL forattachmentUrl
field.This PR:
attachmentUrl
ifattachmentHash
is nullBugfix 2:
CreateOrUpdateArticleReplyFeedback
records wrongarticleReplyUserId
on feedback docIn the image below, the article reply feedback for article![圖片](https://user-images.githubusercontent.com/108608/175776602-5730e187-b789-4fd1-884c-664092557480.png)
2889dua0k41ro
and replysKR1hn0BnX5-aOa4S29I
has itsarticleReplyUserId
beingAWA_PbObyCdS-nWhukq-
; however, according to the article data, the article reply is actually created by userAVqVwjqQyrDaTqlmmp_a
.This PR
articleReplyUserId
This PR is deployed to staging on 6/25.