From 57b5397728ef41c66a52bd983a98f042ea36502d Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 15 Jul 2024 14:11:20 +0800 Subject: [PATCH 01/20] chore(rumors-db): update to latest --- src/rumors-db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rumors-db b/src/rumors-db index 7935de8d..86db6997 160000 --- a/src/rumors-db +++ b/src/rumors-db @@ -1 +1 @@ -Subproject commit 7935de8dde124f1783a6d5d5349d0646e04642ab +Subproject commit 86db6997494477ba1dd2b1911e154403f0cfbb48 From c708d808efb9e77b8aefaaf22e62cd20f6929da9 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 15 Jul 2024 14:11:48 +0800 Subject: [PATCH 02/20] fix(auth): remove extra field in fixture --- src/__fixtures__/auth.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/__fixtures__/auth.js b/src/__fixtures__/auth.js index 26f4f6e8..897e9519 100644 --- a/src/__fixtures__/auth.js +++ b/src/__fixtures__/auth.js @@ -1,6 +1,5 @@ export default { '/users/doc/test-user': { - id: 'test-user', name: 'test user', email: 'secret@secret.com', facebookId: 'secret-fb-id', From 4c59adfaeb1406c24776164e452c761a02e63485 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 15 Jul 2024 14:14:42 +0800 Subject: [PATCH 03/20] chore: update rumors-db --- src/rumors-db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rumors-db b/src/rumors-db index 86db6997..110cc83e 160000 --- a/src/rumors-db +++ b/src/rumors-db @@ -1 +1 @@ -Subproject commit 86db6997494477ba1dd2b1911e154403f0cfbb48 +Subproject commit 110cc83e9d4c117d0eb0c864e1ebd7ba51d8d7e1 From 278fa27c4bdea6c941755f23460c8c97d38f8352 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 15 Jul 2024 14:24:25 +0800 Subject: [PATCH 04/20] fix(*): remove excessive `tags` field from article creation --- src/graphql/mutations/CreateArticle.js | 1 - src/graphql/mutations/CreateMediaArticle.js | 3 +- .../__fixtures__/createBackendUsers.js | 90 ------------------- 3 files changed, 1 insertion(+), 93 deletions(-) diff --git a/src/graphql/mutations/CreateArticle.js b/src/graphql/mutations/CreateArticle.js index 93d31ab2..cab34f1b 100644 --- a/src/graphql/mutations/CreateArticle.js +++ b/src/graphql/mutations/CreateArticle.js @@ -76,7 +76,6 @@ async function createNewArticle({ text, reference: originalReference, user }) { normalArticleReplyCount: 0, normalArticleCategoryCount: 0, replyRequestCount: 0, - tags: [], hyperlinks: [], articleType: 'TEXT', attachmentUrl: '', diff --git a/src/graphql/mutations/CreateMediaArticle.js b/src/graphql/mutations/CreateMediaArticle.js index 9ff9d0c7..c57370cb 100644 --- a/src/graphql/mutations/CreateMediaArticle.js +++ b/src/graphql/mutations/CreateMediaArticle.js @@ -158,7 +158,6 @@ async function createNewMediaArticle({ normalArticleReplyCount: 0, normalArticleCategoryCount: 0, replyRequestCount: 0, - tags: [], hyperlinks: [], articleType, attachmentHash, @@ -288,7 +287,7 @@ export default { }) // It's OK to fail this promise, just log as warning .catch((e) => - console.warn(`[CreateMediaArticle] ${mediaEntry.id}:`, e) + console.warn(`[CreateMediaArticle] ${mediaEntry.id}:`, 'meta' in e ? e.meta : e) ), ]); diff --git a/src/scripts/migrations/__fixtures__/createBackendUsers.js b/src/scripts/migrations/__fixtures__/createBackendUsers.js index f8f7eaf4..7e81f0d4 100644 --- a/src/scripts/migrations/__fixtures__/createBackendUsers.js +++ b/src/scripts/migrations/__fixtures__/createBackendUsers.js @@ -478,7 +478,6 @@ export default { }, ], userId: 'CBUT_user_34', - tags: [], createdAt: '2019-03-18T15:31:50.099Z', articleReplies: [ { @@ -525,7 +524,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-20T00:58:00.000Z', articleReplies: [ { @@ -580,7 +578,6 @@ export default { }, ], userId: 'CBUT_user_39', - tags: [], createdAt: '2018-06-15T07:34:36.490Z', articleReplies: [ { @@ -638,7 +635,6 @@ export default { }, ], userId: 'CBUT_user_15', - tags: [], createdAt: '2019-05-16T15:09:42.254Z', articleReplies: [ { @@ -685,7 +681,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-18T02:58:00.000Z', articleReplies: [ { @@ -731,7 +726,6 @@ export default { }, ], userId: 'CBUT_user_41', - tags: [], createdAt: '2018-01-07T16:35:06.585Z', articleReplies: [ { @@ -785,7 +779,6 @@ export default { }, ], userId: 'CBUT_user_42', - tags: [], createdAt: '2017-12-24T23:48:52.794Z', articleReplies: [ { @@ -837,7 +830,6 @@ export default { }, ], userId: 'CBUT_user_43', - tags: [], createdAt: '2017-11-19T09:35:45.073Z', articleReplies: [ { @@ -882,7 +874,6 @@ export default { }, ], userId: 'CBUT_user_44', - tags: [], createdAt: '2017-03-05T00:13:37.379Z', articleReplies: [ { @@ -936,7 +927,6 @@ export default { }, ], userId: 'CBUT_user_46', - tags: [], createdAt: '2017-08-01T08:45:13.720Z', articleReplies: [ { @@ -990,7 +980,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-16T14:55:00.000Z', articleReplies: [ { @@ -1091,7 +1080,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-16T12:47:00.000Z', articleReplies: [ { @@ -1159,7 +1147,6 @@ export default { }, ], userId: 'CBUT_user_50', - tags: [], createdAt: '2017-11-14T23:42:12.624Z', articleReplies: [ { @@ -1213,7 +1200,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-11T08:52:00.000Z', articleReplies: [ { @@ -1274,7 +1260,6 @@ export default { }, ], userId: 'CBUT_user_51', - tags: [], createdAt: '2018-10-23T09:21:35.323Z', articleReplies: [ { @@ -1367,7 +1352,6 @@ export default { }, ], userId: 'CBUT_user_55', - tags: [], createdAt: '2020-03-03T15:37:27.556Z', articleReplies: [ { @@ -1415,7 +1399,6 @@ export default { }, ], userId: 'CBUT_user_56', - tags: [], createdAt: '2020-02-21T02:02:54.455Z', articleReplies: [ { @@ -1473,7 +1456,6 @@ export default { }, ], userId: 'CBUT_user_58', - tags: [], createdAt: '2017-08-29T03:38:35.524Z', articleReplies: [ { @@ -1543,7 +1525,6 @@ export default { }, ], userId: 'CBUT_user_59', - tags: [], createdAt: '2020-04-17T13:11:33.426Z', articleReplies: [ { @@ -1612,7 +1593,6 @@ export default { }, ], userId: 'CBUT_user_62', - tags: [], createdAt: '2020-04-06T04:35:45.919Z', articleReplies: [ { @@ -1670,7 +1650,6 @@ export default { }, ], userId: 'CBUT_user_64', - tags: [], createdAt: '2019-12-24T02:03:16.857Z', articleReplies: [ { @@ -1760,7 +1739,6 @@ export default { }, ], userId: 'CBUT_user_66', - tags: [], createdAt: '2019-05-30T13:03:09.773Z', articleReplies: [ { @@ -1809,7 +1787,6 @@ export default { }, ], userId: 'CBUT_user_67', - tags: [], createdAt: '2020-04-26T07:32:15.732Z', normalArticleCategoryCount: 1, articleReplies: [ @@ -1874,7 +1851,6 @@ export default { }, ], userId: 'CBUT_user_70', - tags: [], createdAt: '2017-03-13T14:12:52.385Z', articleReplies: [ { @@ -1931,7 +1907,6 @@ export default { }, ], userId: 'CBUT_user_17', - tags: [], createdAt: '2017-05-27T04:06:18.243Z', articleReplies: [ { @@ -1997,7 +1972,6 @@ export default { }, ], userId: 'CBUT_user_72', - tags: [], createdAt: '2018-12-28T13:18:06.346Z', articleReplies: [ { @@ -2076,7 +2050,6 @@ export default { }, ], userId: 'CBUT_user_75', - tags: [], createdAt: '2020-04-03T01:27:41.969Z', articleReplies: [ { @@ -2135,7 +2108,6 @@ export default { }, ], userId: 'CBUT_user_76', - tags: [], createdAt: '2020-02-27T03:27:49.869Z', articleReplies: [ { @@ -2183,7 +2155,6 @@ export default { }, ], userId: 'CBUT_user_77', - tags: [], createdAt: '2019-04-17T06:56:36.132Z', articleReplies: [ { @@ -2234,7 +2205,6 @@ export default { }, ], userId: 'CBUT_user_35', - tags: [], createdAt: '2019-04-15T16:38:11.456Z', articleReplies: [ { @@ -2283,7 +2253,6 @@ export default { }, ], userId: 'CBUT_user_78', - tags: [], createdAt: '2019-11-10T06:18:52.830Z', articleReplies: [ { @@ -2344,7 +2313,6 @@ export default { }, ], userId: 'CBUT_user_35', - tags: [], createdAt: '2019-11-13T16:17:15.137Z', articleReplies: [ { @@ -2393,7 +2361,6 @@ export default { }, ], userId: 'CBUT_user_80', - tags: [], createdAt: '2018-03-30T12:13:57.322Z', articleReplies: [ { @@ -2439,7 +2406,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-10T01:12:00.000Z', articleReplies: [ { @@ -2507,7 +2473,6 @@ export default { }, ], userId: 'CBUT_user_81', - tags: [], createdAt: '2017-06-24T02:25:38.653Z', articleReplies: [ { @@ -2572,7 +2537,6 @@ export default { }, ], userId: 'CBUT_user_82', - tags: [], createdAt: '2017-07-10T11:37:00.087Z', articleReplies: [ { @@ -2629,7 +2593,6 @@ export default { }, ], userId: 'CBUT_user_83', - tags: [], createdAt: '2017-05-14T13:07:55.057Z', articleReplies: [ { @@ -2711,7 +2674,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-22T04:05:00.000Z', articleReplies: [ { @@ -2768,7 +2730,6 @@ export default { }, ], userId: 'CBUT_user_86', - tags: [], createdAt: '2017-12-30T01:01:44.438Z', articleReplies: [ { @@ -2827,7 +2788,6 @@ export default { }, ], userId: 'CBUT_user_87', - tags: [], createdAt: '2019-08-15T02:39:39.532Z', articleReplies: [ { @@ -2898,7 +2858,6 @@ export default { normalArticleReplyCount: 0, normalArticleCategoryCount: 1, replyRequestCount: 2, - tags: [], hyperlinks: [], lastRequestedAt: '2020-09-17T12:44:47.688Z', }, @@ -2910,7 +2869,6 @@ export default { }, ], userId: 'CBUT_user_89', - tags: [], createdAt: '2018-01-26T02:28:32.022Z', articleReplies: [ { @@ -2962,7 +2920,6 @@ export default { }, ], userId: 'CBUT_user_37', - tags: [], createdAt: '2017-01-13T03:49:00.000Z', articleReplies: [ { @@ -3045,7 +3002,6 @@ export default { normalArticleReplyCount: 1, normalArticleCategoryCount: 1, replyRequestCount: 1, - tags: [], hyperlinks: [], lastRequestedAt: '2020-09-26T07:29:51.708Z', }, @@ -3094,7 +3050,6 @@ export default { normalArticleReplyCount: 1, normalArticleCategoryCount: 1, replyRequestCount: 1, - tags: [], hyperlinks: [], lastRequestedAt: '2020-09-26T09:39:48.829Z', }, @@ -10005,7 +9960,6 @@ export default { normalArticleReplyCount: 0, normalArticleCategoryCount: 1, replyRequestCount: 2, - tags: [], hyperlinks: [], lastRequestedAt: '2020-09-17T12:44:47.688Z', appUserId: 'CBUT_user_87', @@ -10021,7 +9975,6 @@ export default { }, ], userId: 'j4S8C_n66M1oaUXCwx_g7G3O5VFjHWL4dbZqq9aiEewD4s8-g', - tags: [], createdAt: '2020-04-06T04:35:45.919Z', articleReplies: [ { @@ -10082,7 +10035,6 @@ export default { }, ], userId: 'j4S8C_4WVN4mcFb9V8KKu6LT8xXvRud2LWcSa-UjL_qvy0ksw', - tags: [], createdAt: '2020-02-27T03:27:49.869Z', articleReplies: [ { @@ -10130,7 +10082,6 @@ export default { }, ], userId: 'j4S8C_v8peSS0932LsPFMsF61kNZqh7-ZkQ_2QHV22_C3PXf4', - tags: [], createdAt: '2017-12-30T01:01:44.438Z', articleReplies: [ { @@ -10192,7 +10143,6 @@ export default { }, ], userId: 'j4S8C_4PNVISSWISKdcDP111lIO_cSmpR1jMjSyzDwLoYDvH4', - tags: [], createdAt: '2018-03-30T12:13:57.322Z', articleReplies: [ { @@ -10240,7 +10190,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-13T03:49:00.000Z', articleReplies: [ { @@ -10288,7 +10237,6 @@ export default { }, ], userId: 'j4S8C_4iGkmTeduiI5SrYlHehwmaS3SX4Nszoyb1oyUWvLMEo', - tags: [], createdAt: '2017-07-10T11:37:00.087Z', articleReplies: [ { @@ -10347,7 +10295,6 @@ export default { }, ], userId: 'j4S8C_pGTVQioRDsflknEcedoVAbKom5K10ipYSV4rWSq2G_4', - tags: [], createdAt: '2018-01-07T16:35:06.585Z', articleReplies: [ { @@ -10406,7 +10353,6 @@ export default { }, ], userId: 'j4S8C_RW_vDd8lKq4WdfWYxmVh6sJImYM96kix8X4A6FhRJHI', - tags: [], createdAt: '2020-03-03T15:37:27.556Z', articleReplies: [ { @@ -10457,7 +10403,6 @@ export default { }, ], userId: 'j4S8C_sJtyYDWJm0yBONBKJix3-poQzSELnS-Xyr7WPZdwvvA', - tags: [], createdAt: '2020-04-03T01:27:41.969Z', articleReplies: [ { @@ -10516,7 +10461,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-22T04:05:00.000Z', articleReplies: [ { @@ -10578,7 +10522,6 @@ export default { }, ], userId: 'j4S8C_VSYVIlqF4l_puOdN_Pzu64YnjMc-nM5iu0OWcWTt4xk', - tags: [], createdAt: '2019-11-10T06:18:52.830Z', articleReplies: [ { @@ -10641,7 +10584,6 @@ export default { }, ], userId: 'j4S8C_xhN2O5Ouv6Y6AbEoDULy9Crc1TRdEaQ03ANLtAEJWnY', - tags: [], createdAt: '2020-04-17T13:11:33.426Z', articleReplies: [ { @@ -10710,7 +10652,6 @@ export default { }, ], userId: 'j4S8C_MKBfQLupvhw4_Pf0ua4s1ag2aNnC7lr88z8Hyx7C31g', - tags: [], createdAt: '2018-01-26T02:28:32.022Z', articleReplies: [ { @@ -10763,7 +10704,6 @@ export default { }, ], userId: 'j4S8C_nEkrBWbE4FfkBTIV9QMn1exDEGReMdemzfznDgx6nA8', - tags: [], createdAt: '2017-03-13T14:12:52.385Z', articleReplies: [ { @@ -10822,7 +10762,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-16T14:55:00.000Z', articleReplies: [ { @@ -10928,7 +10867,6 @@ export default { }, ], userId: 'j4S8C_9V5d6E7GKiGNn1Yv_ifdq_WCxK4GET6BedItZHNN3W0', - tags: [], createdAt: '2018-12-28T13:18:06.346Z', articleReplies: [ { @@ -11010,7 +10948,6 @@ export default { }, ], userId: 'CBUT_user_35', - tags: [], createdAt: '2019-11-13T16:17:15.137Z', articleReplies: [ { @@ -11058,7 +10995,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-16T12:47:00.000Z', articleReplies: [ { @@ -11129,7 +11065,6 @@ export default { }, ], userId: 'j4S8C_uURhRzjSSV6s0wz7Patvy8Fb2hBM46AgZeTSyZ0OUfk', - tags: [], createdAt: '2017-11-19T09:35:45.073Z', articleReplies: [ { @@ -11177,7 +11112,6 @@ export default { }, ], userId: 'j4S8C_YWVSKKajD6USiTghIEQzrWT_YKdnVVqVI96-cyS6zWA', - tags: [], createdAt: '2017-06-24T02:25:38.653Z', articleReplies: [ { @@ -11244,7 +11178,6 @@ export default { }, ], userId: 'j4S8C_igegSRiBLdZh9argcdWuKn3cZzYGaSCes5WLJr-9l2s', - tags: [], createdAt: '2017-08-29T03:38:35.524Z', articleReplies: [ { @@ -11317,7 +11250,6 @@ export default { }, ], userId: 'j4S8C_Y1PaNolSaA4JExH8wY1ODwOCa4lNbbsPOtxJts305XU', - tags: [], createdAt: '2019-08-15T02:39:39.532Z', articleReplies: [ { @@ -11369,7 +11301,6 @@ export default { }, ], userId: 'j4S8C_nRWu8ne4K6M1m6ibF8HbOq07hUxK3pvrOD4g7cn-okY', - tags: [], createdAt: '2019-12-24T02:03:16.857Z', articleReplies: [ { @@ -11462,7 +11393,6 @@ export default { }, ], userId: 'qO1C3_lAgNK9-guL13qEJSGROTsi_UZbF5N5WoQ17vnsOrl6s', - tags: [], createdAt: '2019-03-18T15:31:50.099Z', articleReplies: [ { @@ -11511,7 +11441,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-20T00:58:00.000Z', articleReplies: [ { @@ -11569,7 +11498,6 @@ export default { }, ], userId: 'j4S8C_f0pGq97e0_aH_2-8x0BLaj36xzuu2M1W54ZVcAZ4fM0', - tags: [], createdAt: '2018-06-15T07:34:36.490Z', articleReplies: [ { @@ -11630,7 +11558,6 @@ export default { }, ], userId: 'CBUT_user_15', - tags: [], createdAt: '2019-05-16T15:09:42.254Z', articleReplies: [ { @@ -11678,7 +11605,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-18T02:58:00.000Z', articleReplies: [ { @@ -11726,7 +11652,6 @@ export default { }, ], userId: 'j4S8C_FQn8c8K4i67IISzvXVoOPipzRASqSgeBxPLNjReHVyY', - tags: [], createdAt: '2017-12-24T23:48:52.794Z', articleReplies: [ { @@ -11779,7 +11704,6 @@ export default { }, ], userId: 'j4S8C_pYR1NvuKvLQfho6HCkJWbMqLYFnDzoATlM4SyqsxdEU', - tags: [], createdAt: '2017-03-05T00:13:37.379Z', articleReplies: [ { @@ -11835,7 +11759,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-11T08:52:00.000Z', articleReplies: [ { @@ -11893,7 +11816,6 @@ export default { }, ], userId: 'j4S8C_TthEcGGgLb2we2tKAG98NuJq1KJE6Bd2WbQPK7kqG2M', - tags: [], createdAt: '2020-02-21T02:02:54.455Z', articleReplies: [ { @@ -11956,7 +11878,6 @@ export default { }, ], userId: 'j4S8C_AunHFdGqCNC2QRUrQ9PSqkcE49Z4JTrkG9mYcgeogm8', - tags: [], createdAt: '2020-04-26T07:32:15.732Z', normalArticleCategoryCount: 1, articleReplies: [ @@ -12027,7 +11948,6 @@ export default { }, ], userId: 'j4S8C_fqo4vs7i2gmJi3mc1zlp_YgMi2_xyGiHfOR5_eLeYkE', - tags: [], createdAt: '2019-05-30T13:03:09.773Z', articleReplies: [ { @@ -12076,7 +11996,6 @@ export default { }, ], userId: 'j4S8C_qmqlhUR3yeWRZcuwPI8CP1A7XREZrNc5h3JtIy4q_Lo', - tags: [], createdAt: '2017-05-27T04:06:18.243Z', articleReplies: [ { @@ -12145,7 +12064,6 @@ export default { }, ], userId: 'j4S8C_ppZEoc7CPAXLOlzNOj3zwN_re6FKnwtjIiMmzS0_TFk', - tags: [], createdAt: '2019-04-17T06:56:36.132Z', articleReplies: [ { @@ -12198,7 +12116,6 @@ export default { }, ], userId: 'CBUT_user_35', - tags: [], createdAt: '2019-04-15T16:38:11.456Z', articleReplies: [ { @@ -12284,7 +12201,6 @@ export default { normalArticleReplyCount: 1, normalArticleCategoryCount: 1, replyRequestCount: 1, - tags: [], hyperlinks: [], lastRequestedAt: '2020-09-26T07:29:51.708Z', }, @@ -12334,7 +12250,6 @@ export default { normalArticleReplyCount: 1, normalArticleCategoryCount: 1, replyRequestCount: 1, - tags: [], hyperlinks: [], lastRequestedAt: '2020-09-26T09:39:48.829Z', }, @@ -12346,7 +12261,6 @@ export default { }, ], userId: 'j4S8C_lQfJ8fARjHNzkXa4s0ZENAkcWbKn_UOARG7VY11af8E', - tags: [], createdAt: '2017-11-14T23:42:12.624Z', articleReplies: [ { @@ -12402,7 +12316,6 @@ export default { }, ], userId: 'Z0k1e_3tpHtWzO6L-HfjoQpFDln3K3YQHkvLIUzCBUhDznwqU', - tags: [], createdAt: '2017-01-10T01:12:00.000Z', articleReplies: [ { @@ -12482,7 +12395,6 @@ export default { }, ], userId: 'j4S8C_rjLUCvhHqmYeT37nsWvYMXt7o0r3Mbniqdr7qU5LXgo', - tags: [], createdAt: '2018-10-23T09:21:35.323Z', articleReplies: [ { @@ -12575,7 +12487,6 @@ export default { }, ], userId: 'j4S8C_Z8nYqKv190EeosqG5O1H8aeTg64m6xLkRyZOTxSYQ7A', - tags: [], createdAt: '2017-08-01T08:45:13.720Z', articleReplies: [ { @@ -12631,7 +12542,6 @@ export default { }, ], userId: 'j4S8C_Yk4N-rJ2LtcKZc0Wa2smuJQNB5I7mmo-d2j1k-nyfSo', - tags: [], createdAt: '2017-05-14T13:07:55.057Z', articleReplies: [ { From 4d47c857f587bb2ebdc7f6a8c81fbe3bdb6c0e82 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 15 Jul 2024 14:28:29 +0800 Subject: [PATCH 05/20] fix(mutation): fix lint for CreateMediaArticle --- src/graphql/mutations/CreateMediaArticle.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/graphql/mutations/CreateMediaArticle.js b/src/graphql/mutations/CreateMediaArticle.js index c57370cb..978d8029 100644 --- a/src/graphql/mutations/CreateMediaArticle.js +++ b/src/graphql/mutations/CreateMediaArticle.js @@ -287,7 +287,12 @@ export default { }) // It's OK to fail this promise, just log as warning .catch((e) => - console.warn(`[CreateMediaArticle] ${mediaEntry.id}:`, 'meta' in e ? e.meta : e) + console.warn( + `[CreateMediaArticle] ${mediaEntry.id}:`, + + // `meta` is provided by elasticsearch error response + 'meta' in e ? e.meta : e + ) ), ]); From 36c981b31db3c64af58121765ee0b3401ac53a85 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 15 Jul 2024 14:32:55 +0800 Subject: [PATCH 06/20] fix: typo --- src/graphql/mutations/CreateMediaArticle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphql/mutations/CreateMediaArticle.js b/src/graphql/mutations/CreateMediaArticle.js index 978d8029..4c802b29 100644 --- a/src/graphql/mutations/CreateMediaArticle.js +++ b/src/graphql/mutations/CreateMediaArticle.js @@ -290,7 +290,7 @@ export default { console.warn( `[CreateMediaArticle] ${mediaEntry.id}:`, - // `meta` is provided by elasticsearch error response + // `meta` is provided by elasticsearch error response 'meta' in e ? e.meta : e ) ), From 7a31a865f6c3d3797ee78b3f7f51739fea4717c3 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Fri, 30 Aug 2024 10:15:39 +0800 Subject: [PATCH 07/20] chore(rumors-db): update DB to latest --- src/rumors-db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rumors-db b/src/rumors-db index 110cc83e..6fdaedae 160000 --- a/src/rumors-db +++ b/src/rumors-db @@ -1 +1 @@ -Subproject commit 110cc83e9d4c117d0eb0c864e1ebd7ba51d8d7e1 +Subproject commit 6fdaedaeef3caf0b916df09907be6aa14b142ab0 From 8515f4f28ff056f9064cc7c03c7f450821e38e90 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:04:36 +0800 Subject: [PATCH 08/20] fix(graphql): remove excessive field in user fixture --- src/graphql/dataLoaders/__fixtures__/userLoaderFactory.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/graphql/dataLoaders/__fixtures__/userLoaderFactory.js b/src/graphql/dataLoaders/__fixtures__/userLoaderFactory.js index 479bc6af..0e28cf41 100644 --- a/src/graphql/dataLoaders/__fixtures__/userLoaderFactory.js +++ b/src/graphql/dataLoaders/__fixtures__/userLoaderFactory.js @@ -1,12 +1,10 @@ export default { '/users/doc/test-user': { - id: 'test-user', slug: 'abc123', name: 'test user', email: 'secret@secret.com', }, '/users/doc/test-user2': { - id: 'test-user2', slug: 'def456', name: 'test user2', email: 'hi@me.com', From e5d8926e669788472a7c7888ae3da602e8e28092 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:05:17 +0800 Subject: [PATCH 09/20] fix(scripts): createBackendUsers fixture typo --- .../__fixtures__/createBackendUsers.js | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/scripts/migrations/__fixtures__/createBackendUsers.js b/src/scripts/migrations/__fixtures__/createBackendUsers.js index 7e81f0d4..bbce4e6f 100644 --- a/src/scripts/migrations/__fixtures__/createBackendUsers.js +++ b/src/scripts/migrations/__fixtures__/createBackendUsers.js @@ -511,7 +511,7 @@ export default { appId: 'DEVELOPMENT_BACKEND', lastRequestedAt: '2019-03-18T15:31:50.146Z', text: 'Newsgeist is a horrible event. People are doing nothing here.', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-03-18T15:31:50.099Z', normalArticleCategoryCount: 1, @@ -611,7 +611,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-06-15T07:34:36.502Z', text: '讚!國民黨有史以來打民進黨蔡英文最好的一支廣告.既傳神又生動,大家努力的傳出去https://m.youtube.com/watch?v=VVHf9ni09m4&feature=youtu.be', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [ { summary: @@ -668,7 +668,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-05-16T15:09:42.281Z', text: '可惡至極的政府亂搞教育政策!這可以秀出來教嗎?這要禍害下一代!', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-05-16T15:09:42.254Z', normalArticleCategoryCount: 1, @@ -1337,7 +1337,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-05T13:22:22.965Z', text: '大法官已釋憲,如果年底公投沒達到500萬票,明年五月台灣將成為亞洲第一個同性可合法結婚的國家。\n\n外國同性戀藉結婚來台治療愛滋病,都是健保支付,全民買單。\n\n學...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2018-10-30T01:50:21.966Z', normalArticleCategoryCount: 1, @@ -1443,7 +1443,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2020-02-21T02:02:55.271Z', text: '意大利羅馬周三,下起了從來沒見過,也沒聽說過的石頭雨。這回意大利下的石頭雨就讓人見識了大自然的不可預測,不可控制,不可防範的天災,也再次見識了極端天氣之恐怖!\n...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2020-02-21T02:02:54.455Z', normalArticleCategoryCount: 1, @@ -1715,7 +1715,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-12-24T02:55:11.261Z', text: '民進黨已經通過了毒品條例了\n\n校園內可以擁有50克的毒品,才被視同販毒。\n\n台灣除了是(同性戀島)\n(愛滋病島)現在又增加了一個(毒品島)了\n校園毒品零容忍遭封...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [ { normalizedUrl: @@ -1772,7 +1772,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-05-30T13:03:09.792Z', text: '(moon)A,戀人\n\n他是愛你的,你在他眼中你是是完美的戀人,你的優點缺點他都能夠接受。\n情人眼裡出西施,說的就是他,你們在一起是他最為榮幸的,他覺得你是他一...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-05-30T13:03:09.773Z', normalArticleCategoryCount: 1, @@ -2027,7 +2027,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-28T13:18:06.372Z', text: '奇蹟!燙到後趕快用它!連紅印和水泡都不會有!每家廚房都有,比沖水更有效!:https://youtu.be/EI_oExo38fA', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [ { summary: @@ -2188,7 +2188,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-04-17T06:56:36.153Z', text: '日本人砍台灣樹林比台灣人砍的還要多?', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-04-17T06:56:36.132Z', normalArticleCategoryCount: 1, @@ -2238,7 +2238,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-04-15T16:38:11.473Z', text: '一名網友在「韓國瑜加油團」臉書社團發文指出,經在高雄市政府工作的朋友告知,韓國瑜此行訪美,川普特別透過秘密管道向高市府傳達求見意願,還強調之所以會找上韓國瑜,是...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-04-15T16:38:11.456Z', normalArticleCategoryCount: 1, @@ -2297,7 +2297,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-11-10T06:18:52.860Z', text: '电視新聞報導医生檢查女記者的肺部,發現常使用手機的人,肺部迅速老化,那位女記者才二十多歲,肺部老化,相當四十多歲的人。好恐怖!三C產品盡量少用。', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-11-10T06:18:52.830Z', normalArticleCategoryCount: 1, @@ -2346,7 +2346,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-11-13T16:17:15.156Z', text: 'My experience with burns is this:\nOnce I was cooking some corn and stuck my fork...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-11-13T16:17:15.137Z', normalArticleCategoryCount: 1, @@ -2394,7 +2394,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-03-30T12:13:57.363Z', text: '民眾檢舉交通罰單籲7日不用繳費', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, updatedAt: '2018-03-30T12:13:57.322Z', normalArticleCategoryCount: 1, }, @@ -2821,7 +2821,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-08-15T02:39:39.597Z', text: '運動手錶跟手機互聯,當然手機內所有資料都會進入他們的伺服器(任何品牌都如此)唯獨中國只要發送「詆譭攻擊等圖文」就會鎖定情搜追蹤你。以保護自己及國安角度,供大家參考。', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-08-15T02:39:39.532Z', normalArticleCategoryCount: 1, @@ -10177,7 +10177,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-03-30T12:13:57.363Z', text: '民眾檢舉交通罰單籲7日不用繳費', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, updatedAt: '2018-03-30T12:13:57.322Z', normalArticleCategoryCount: 1, appUserId: 'CBUT_user_80', @@ -10567,7 +10567,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-11-10T06:18:52.860Z', text: '电視新聞報導医生檢查女記者的肺部,發現常使用手機的人,肺部迅速老化,那位女記者才二十多歲,肺部老化,相當四十多歲的人。好恐怖!三C產品盡量少用。', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-11-10T06:18:52.830Z', normalArticleCategoryCount: 1, @@ -10923,7 +10923,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-28T13:18:06.372Z', text: '奇蹟!燙到後趕快用它!連紅印和水泡都不會有!每家廚房都有,比沖水更有效!:https://youtu.be/EI_oExo38fA', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [ { summary: @@ -10982,7 +10982,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-11-13T16:17:15.156Z', text: 'My experience with burns is this:\nOnce I was cooking some corn and stuck my fork...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-11-13T16:17:15.137Z', normalArticleCategoryCount: 1, @@ -11284,7 +11284,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-08-15T02:39:39.597Z', text: '運動手錶跟手機互聯,當然手機內所有資料都會進入他們的伺服器(任何品牌都如此)唯獨中國只要發送「詆譭攻擊等圖文」就會鎖定情搜追蹤你。以保護自己及國安角度,供大家參考。', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-08-15T02:39:39.532Z', normalArticleCategoryCount: 1, @@ -11367,7 +11367,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-12-24T02:55:11.261Z', text: '民進黨已經通過了毒品條例了\n\n校園內可以擁有50克的毒品,才被視同販毒。\n\n台灣除了是(同性戀島)\n(愛滋病島)現在又增加了一個(毒品島)了\n校園毒品零容忍遭封...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [ { normalizedUrl: @@ -11427,7 +11427,7 @@ export default { appId: 'DEVELOPMENT_BACKEND', lastRequestedAt: '2019-03-18T15:31:50.146Z', text: 'Newsgeist is a horrible event. People are doing nothing here.', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-03-18T15:31:50.099Z', normalArticleCategoryCount: 1, @@ -11532,7 +11532,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-06-15T07:34:36.502Z', text: '讚!國民黨有史以來打民進黨蔡英文最好的一支廣告.既傳神又生動,大家努力的傳出去https://m.youtube.com/watch?v=VVHf9ni09m4&feature=youtu.be', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [ { summary: @@ -11592,7 +11592,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-05-16T15:09:42.281Z', text: '可惡至極的政府亂搞教育政策!這可以秀出來教嗎?這要禍害下一代!', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-05-16T15:09:42.254Z', normalArticleCategoryCount: 1, @@ -11861,7 +11861,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2020-02-21T02:02:55.271Z', text: '意大利羅馬周三,下起了從來沒見過,也沒聽說過的石頭雨。這回意大利下的石頭雨就讓人見識了大自然的不可預測,不可控制,不可防範的天災,也再次見識了極端天氣之恐怖!\n...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2020-02-21T02:02:54.455Z', normalArticleCategoryCount: 1, @@ -11982,7 +11982,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-05-30T13:03:09.792Z', text: '(moon)A,戀人\n\n他是愛你的,你在他眼中你是是完美的戀人,你的優點缺點他都能夠接受。\n情人眼裡出西施,說的就是他,你們在一起是他最為榮幸的,他覺得你是他一...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-05-30T13:03:09.773Z', normalArticleCategoryCount: 1, @@ -12098,7 +12098,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-04-17T06:56:36.153Z', text: '日本人砍台灣樹林比台灣人砍的還要多?', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-04-17T06:56:36.132Z', normalArticleCategoryCount: 1, @@ -12150,7 +12150,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-04-15T16:38:11.473Z', text: '一名網友在「韓國瑜加油團」臉書社團發文指出,經在高雄市政府工作的朋友告知,韓國瑜此行訪美,川普特別透過秘密管道向高市府傳達求見意願,還強調之所以會找上韓國瑜,是...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2019-04-15T16:38:11.456Z', normalArticleCategoryCount: 1, @@ -12473,7 +12473,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-05T13:22:22.965Z', text: '大法官已釋憲,如果年底公投沒達到500萬票,明年五月台灣將成為亞洲第一個同性可合法結婚的國家。\n\n外國同性戀藉結婚來台治療愛滋病,都是健保支付,全民買單。\n\n學...', - normalArticleReplycount: 0, + normalArticleReplyCount: 0, hyperlinks: [], updatedAt: '2018-10-30T01:50:21.966Z', normalArticleCategoryCount: 1, From 84c6fc7a0f7e0c81cb03d7b3ac759af74bebe1b9 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:05:41 +0800 Subject: [PATCH 10/20] fix(mutation): remove outdated field from CreateArticle snapshot --- .../mutations/__tests__/__snapshots__/CreateArticle.js.snap | 1 - 1 file changed, 1 deletion(-) diff --git a/src/graphql/mutations/__tests__/__snapshots__/CreateArticle.js.snap b/src/graphql/mutations/__tests__/__snapshots__/CreateArticle.js.snap index bbcad3c4..5b969598 100644 --- a/src/graphql/mutations/__tests__/__snapshots__/CreateArticle.js.snap +++ b/src/graphql/mutations/__tests__/__snapshots__/CreateArticle.js.snap @@ -51,7 +51,6 @@ Object { ], "replyRequestCount": 1, "status": "NORMAL", - "tags": Array [], "text": "FOO FOO http://foo.com/article/1", "updatedAt": "2017-01-28T08:45:57.011Z", "userId": "test", From 1456502bbb5ce51e785dc901402eb1f997f61f5d Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:12:06 +0800 Subject: [PATCH 11/20] fix(mutations): UpdateUser wrong fixture field --- .../mutations/__fixtures__/UpdateUser.js | 18 +++--------- src/graphql/mutations/__tests__/UpdateUser.js | 29 +++++++++---------- .../__snapshots__/UpdateUser.js.snap | 12 -------- 3 files changed, 18 insertions(+), 41 deletions(-) diff --git a/src/graphql/mutations/__fixtures__/UpdateUser.js b/src/graphql/mutations/__fixtures__/UpdateUser.js index dda06a79..b9870628 100644 --- a/src/graphql/mutations/__fixtures__/UpdateUser.js +++ b/src/graphql/mutations/__fixtures__/UpdateUser.js @@ -1,29 +1,19 @@ export default { '/users/doc/error': { - users: [ - { - name: 'Bill', - updatedAt: 0, - }, - ], + name: 'Bill', + updatedAt: 0, }, '/users/doc/normal': { - users: [ - { - name: 'Bill', - updatedAt: 0, - }, - ], + name: 'Bill', + updatedAt: 0, }, '/users/doc/testUser1': { - id: 'testUser1', name: 'test user 1', facebookId: 'fbid123', githubId: 'githubId123', email: 'user1@example.com', }, '/users/doc/testUser2': { - id: 'testUser2', name: 'test user 2', githubId: 'githubId456', email: 'user2@example.com', diff --git a/src/graphql/mutations/__tests__/UpdateUser.js b/src/graphql/mutations/__tests__/UpdateUser.js index fa7804e8..f8b206a9 100644 --- a/src/graphql/mutations/__tests__/UpdateUser.js +++ b/src/graphql/mutations/__tests__/UpdateUser.js @@ -4,7 +4,6 @@ import client from 'util/client'; import MockDate from 'mockdate'; import fixtures from '../__fixtures__/UpdateUser'; -const testUser1 = fixtures['/users/doc/testUser1']; const testUser2 = fixtures['/users/doc/testUser2']; const updateUser = (variableString, userId) => @@ -75,77 +74,77 @@ describe('UpdateUser', () => { it('should set user slug field correctly', async () => { const { data, errors } = await updateUser( `slug: "test-user-1"`, - testUser1.id + 'testUser1' ); expect(errors).toBe(undefined); expect(data).toMatchSnapshot(); - expect(await getUser(testUser1.id)).toMatchSnapshot(); + expect(await getUser('testUser1')).toMatchSnapshot(); }); it('cannot set duplicated slug', async () => { const { errors } = await updateUser( `slug: "${testUser2.slug}"`, - testUser1.id + 'testUser1' ); expect(errors).toMatchSnapshot(); - expect(await getUser(testUser1.id)).toMatchSnapshot(); + expect(await getUser('testUser1')).toMatchSnapshot(); }); it('should set all provided fields correctly', async () => { const { data, errors } = await updateUser( `slug: "test-user-3", name: "new name", avatarType: Gravatar, bio: "blahblahblah"`, - testUser1.id + 'testUser1' ); expect(errors).toBe(undefined); expect(data).toMatchSnapshot(); - expect(await getUser(testUser1.id)).toMatchSnapshot(); + expect(await getUser('testUser1')).toMatchSnapshot(); }); it('should not set unsupported fields', async () => { const { errors } = await updateUser( `email: "newemail@example.com"`, - testUser1.id + 'testUser1' ); expect(errors).toMatchSnapshot(); - expect(await getUser(testUser1.id)).toMatchSnapshot(); + expect(await getUser('testUser1')).toMatchSnapshot(); }); it('should not unset fields', async () => { - const { errors } = await updateUser(`slug: "", name: null`, testUser1.id); + const { errors } = await updateUser(`slug: "", name: null`, 'testUser1'); expect(errors).toMatchSnapshot(); - expect(await getUser(testUser1.id)).toMatchSnapshot(); + expect(await getUser('testUser1')).toMatchSnapshot(); }); it('should preserve avatarData field for non openpeeps avatar', async () => { let { data, errors } = await updateUser( `avatarData:"""{"key":"value"}""", avatarType: OpenPeeps`, - testUser1.id + 'testUser1' ); expect(errors).toBe(undefined); expect(data).toMatchSnapshot('openpeeps'); - ({ data, errors } = await updateUser(`avatarType: Facebook`, testUser1.id)); + ({ data, errors } = await updateUser(`avatarType: Facebook`, 'testUser1')); expect(errors).toBe(undefined); expect(data).toMatchSnapshot('facebook'); ({ data, errors } = await updateUser( `avatarType: Github, avatarData:"""{"key":"123"}"""`, - testUser1.id + 'testUser1' )); expect(errors).toBe(undefined); expect(data).toMatchSnapshot('github'); - expect(await getUser(testUser1.id)).toMatchSnapshot(); + expect(await getUser('testUser1')).toMatchSnapshot(); }); afterAll(() => { diff --git a/src/graphql/mutations/__tests__/__snapshots__/UpdateUser.js.snap b/src/graphql/mutations/__tests__/__snapshots__/UpdateUser.js.snap index 5f49fe1d..7967413e 100644 --- a/src/graphql/mutations/__tests__/__snapshots__/UpdateUser.js.snap +++ b/src/graphql/mutations/__tests__/__snapshots__/UpdateUser.js.snap @@ -11,7 +11,6 @@ Object { "email": "user1@example.com", "facebookId": "fbid123", "githubId": "githubId123", - "id": "testUser1", "name": "test user 1", "slug": "test-user-1", "updatedAt": "2020-01-01T00:00:10.000Z", @@ -31,7 +30,6 @@ Object { "email": "user1@example.com", "facebookId": "fbid123", "githubId": "githubId123", - "id": "testUser1", "name": "new name", "slug": "test-user-3", "updatedAt": "2020-01-01T00:00:30.000Z", @@ -51,7 +49,6 @@ Object { "email": "user1@example.com", "facebookId": "fbid123", "githubId": "githubId123", - "id": "testUser1", "name": "new name", "slug": "test-user-3", "updatedAt": "2020-01-01T00:00:30.000Z", @@ -66,7 +63,6 @@ Object { "email": "user1@example.com", "facebookId": "fbid123", "githubId": "githubId123", - "id": "testUser1", "name": "new name", "slug": "test-user-3", "updatedAt": "2020-01-01T00:01:00.000Z", @@ -140,7 +136,6 @@ Object { "email": "user1@example.com", "facebookId": "fbid123", "githubId": "githubId123", - "id": "testUser1", "name": "new name", "slug": "test-user-3", "updatedAt": "2020-01-01T00:00:30.000Z", @@ -161,12 +156,6 @@ exports[`UpdateUser should set user name field correctly 2`] = ` Object { "name": "Mark", "updatedAt": "2020-01-01T00:00:00.000Z", - "users": Array [ - Object { - "name": "Bill", - "updatedAt": 0, - }, - ], } `; @@ -190,7 +179,6 @@ Object { "email": "user1@example.com", "facebookId": "fbid123", "githubId": "githubId123", - "id": "testUser1", "name": "test user 1", "slug": "test-user-1", "updatedAt": "2020-01-01T00:00:10.000Z", From 8cb29412f326b02362e165d0e810f0305e0ab694 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:15:29 +0800 Subject: [PATCH 12/20] fix(mutation): remove unused field from article created by CreateMediaArticle --- src/graphql/mutations/__tests__/CreateMediaArticle.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/graphql/mutations/__tests__/CreateMediaArticle.js b/src/graphql/mutations/__tests__/CreateMediaArticle.js index b7f04b1c..fb2abe5d 100644 --- a/src/graphql/mutations/__tests__/CreateMediaArticle.js +++ b/src/graphql/mutations/__tests__/CreateMediaArticle.js @@ -112,7 +112,6 @@ describe('creation', () => { ], "replyRequestCount": 1, "status": "NORMAL", - "tags": Array [], "text": "OCR result of output image", "updatedAt": "2017-01-28T08:45:57.011Z", "userId": "test", From 0b5591363fe95a363c549ec9291dff5e2edaf6e5 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:19:18 +0800 Subject: [PATCH 13/20] fix(queries): fix GetUser fixture --- src/graphql/queries/__fixtures__/GetUser.js | 4 ---- src/graphql/queries/__tests__/GetUser.js | 10 ++++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/graphql/queries/__fixtures__/GetUser.js b/src/graphql/queries/__fixtures__/GetUser.js index 95d1e8b3..d03b6922 100644 --- a/src/graphql/queries/__fixtures__/GetUser.js +++ b/src/graphql/queries/__fixtures__/GetUser.js @@ -1,6 +1,5 @@ export default { '/users/doc/test-user': { - id: 'test-user', slug: 'abc123', name: 'test user', email: 'secret@secret.com', @@ -8,7 +7,6 @@ export default { facebookId: 123456, }, '/users/doc/current-user': { - id: 'current-user', slug: 'def456', name: 'current user', email: 'hi@me.com', @@ -16,13 +14,11 @@ export default { githubId: 654321, }, '/users/doc/test-email-user': { - id: 'test-email-user', slug: 'ghi789', name: 'test email user', email: 'cofacts.tw@gmail.com', }, '/users/doc/another-user': { - id: 'another-user', name: 'open peeps user', email: 'user@example.com', avatarType: 'OpenPeeps', diff --git a/src/graphql/queries/__tests__/GetUser.js b/src/graphql/queries/__tests__/GetUser.js index 5c606668..16f068ce 100644 --- a/src/graphql/queries/__tests__/GetUser.js +++ b/src/graphql/queries/__tests__/GetUser.js @@ -2,8 +2,14 @@ import gql from 'util/GraphQL'; import { loadFixtures, unloadFixtures } from 'util/fixtures'; import fixtures from '../__fixtures__/GetUser'; -const currentUser = fixtures['/users/doc/current-user']; -const testEmailUser = fixtures['/users/doc/test-email-user']; +const currentUser = { + ...fixtures['/users/doc/current-user'], + id: 'current-user', +}; +const testEmailUser = { + ...fixtures['/users/doc/test-email-user'], + id: 'test-email-user', +}; describe('GetUser', () => { beforeAll(() => loadFixtures(fixtures)); From 593236ced979e387b5ad4c24153483126c64552c Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:19:31 +0800 Subject: [PATCH 14/20] fix(queries): fix ListReplyRequests fixtures --- src/graphql/queries/__fixtures__/ListReplyRequests.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/graphql/queries/__fixtures__/ListReplyRequests.js b/src/graphql/queries/__fixtures__/ListReplyRequests.js index dbf568eb..78789a1d 100644 --- a/src/graphql/queries/__fixtures__/ListReplyRequests.js +++ b/src/graphql/queries/__fixtures__/ListReplyRequests.js @@ -94,12 +94,10 @@ export default { updatedAt: '2020-01-01T00:00:00.000Z', }, '/users/doc/user1': { - id: 'user1', appId: 'WEBSITE', name: 'user 1', }, '/users/doc/user2': { - id: 'user2', appId: 'WEBSITE', name: 'user 2', }, From c0b451f7593b5f46126ae90f8845d496ff729e56 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:21:23 +0800 Subject: [PATCH 15/20] fix(mutations): fix validateSlug fixture --- src/graphql/queries/__fixtures__/ValidateSlug.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/graphql/queries/__fixtures__/ValidateSlug.js b/src/graphql/queries/__fixtures__/ValidateSlug.js index 5ff2cc30..9e7102d7 100644 --- a/src/graphql/queries/__fixtures__/ValidateSlug.js +++ b/src/graphql/queries/__fixtures__/ValidateSlug.js @@ -1,6 +1,5 @@ export default { '/users/doc/test-user': { - id: 'test-user', slug: 'taken', name: 'test user', email: 'secret@secret.com', From 57f17f6084ae008eda4da0754c6f79e94f8d1789 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:31:09 +0800 Subject: [PATCH 16/20] Revert "fix(scripts): createBackendUsers fixture typo" This reverts commit e5d8926e669788472a7c7888ae3da602e8e28092. --- .../__fixtures__/createBackendUsers.js | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/scripts/migrations/__fixtures__/createBackendUsers.js b/src/scripts/migrations/__fixtures__/createBackendUsers.js index bbce4e6f..7e81f0d4 100644 --- a/src/scripts/migrations/__fixtures__/createBackendUsers.js +++ b/src/scripts/migrations/__fixtures__/createBackendUsers.js @@ -511,7 +511,7 @@ export default { appId: 'DEVELOPMENT_BACKEND', lastRequestedAt: '2019-03-18T15:31:50.146Z', text: 'Newsgeist is a horrible event. People are doing nothing here.', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-03-18T15:31:50.099Z', normalArticleCategoryCount: 1, @@ -611,7 +611,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-06-15T07:34:36.502Z', text: '讚!國民黨有史以來打民進黨蔡英文最好的一支廣告.既傳神又生動,大家努力的傳出去https://m.youtube.com/watch?v=VVHf9ni09m4&feature=youtu.be', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -668,7 +668,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-05-16T15:09:42.281Z', text: '可惡至極的政府亂搞教育政策!這可以秀出來教嗎?這要禍害下一代!', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-16T15:09:42.254Z', normalArticleCategoryCount: 1, @@ -1337,7 +1337,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-05T13:22:22.965Z', text: '大法官已釋憲,如果年底公投沒達到500萬票,明年五月台灣將成為亞洲第一個同性可合法結婚的國家。\n\n外國同性戀藉結婚來台治療愛滋病,都是健保支付,全民買單。\n\n學...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2018-10-30T01:50:21.966Z', normalArticleCategoryCount: 1, @@ -1443,7 +1443,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2020-02-21T02:02:55.271Z', text: '意大利羅馬周三,下起了從來沒見過,也沒聽說過的石頭雨。這回意大利下的石頭雨就讓人見識了大自然的不可預測,不可控制,不可防範的天災,也再次見識了極端天氣之恐怖!\n...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2020-02-21T02:02:54.455Z', normalArticleCategoryCount: 1, @@ -1715,7 +1715,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-12-24T02:55:11.261Z', text: '民進黨已經通過了毒品條例了\n\n校園內可以擁有50克的毒品,才被視同販毒。\n\n台灣除了是(同性戀島)\n(愛滋病島)現在又增加了一個(毒品島)了\n校園毒品零容忍遭封...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [ { normalizedUrl: @@ -1772,7 +1772,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-05-30T13:03:09.792Z', text: '(moon)A,戀人\n\n他是愛你的,你在他眼中你是是完美的戀人,你的優點缺點他都能夠接受。\n情人眼裡出西施,說的就是他,你們在一起是他最為榮幸的,他覺得你是他一...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-30T13:03:09.773Z', normalArticleCategoryCount: 1, @@ -2027,7 +2027,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-28T13:18:06.372Z', text: '奇蹟!燙到後趕快用它!連紅印和水泡都不會有!每家廚房都有,比沖水更有效!:https://youtu.be/EI_oExo38fA', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -2188,7 +2188,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-04-17T06:56:36.153Z', text: '日本人砍台灣樹林比台灣人砍的還要多?', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-17T06:56:36.132Z', normalArticleCategoryCount: 1, @@ -2238,7 +2238,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-04-15T16:38:11.473Z', text: '一名網友在「韓國瑜加油團」臉書社團發文指出,經在高雄市政府工作的朋友告知,韓國瑜此行訪美,川普特別透過秘密管道向高市府傳達求見意願,還強調之所以會找上韓國瑜,是...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-15T16:38:11.456Z', normalArticleCategoryCount: 1, @@ -2297,7 +2297,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-11-10T06:18:52.860Z', text: '电視新聞報導医生檢查女記者的肺部,發現常使用手機的人,肺部迅速老化,那位女記者才二十多歲,肺部老化,相當四十多歲的人。好恐怖!三C產品盡量少用。', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-10T06:18:52.830Z', normalArticleCategoryCount: 1, @@ -2346,7 +2346,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-11-13T16:17:15.156Z', text: 'My experience with burns is this:\nOnce I was cooking some corn and stuck my fork...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-13T16:17:15.137Z', normalArticleCategoryCount: 1, @@ -2394,7 +2394,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-03-30T12:13:57.363Z', text: '民眾檢舉交通罰單籲7日不用繳費', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, updatedAt: '2018-03-30T12:13:57.322Z', normalArticleCategoryCount: 1, }, @@ -2821,7 +2821,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-08-15T02:39:39.597Z', text: '運動手錶跟手機互聯,當然手機內所有資料都會進入他們的伺服器(任何品牌都如此)唯獨中國只要發送「詆譭攻擊等圖文」就會鎖定情搜追蹤你。以保護自己及國安角度,供大家參考。', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-08-15T02:39:39.532Z', normalArticleCategoryCount: 1, @@ -10177,7 +10177,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-03-30T12:13:57.363Z', text: '民眾檢舉交通罰單籲7日不用繳費', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, updatedAt: '2018-03-30T12:13:57.322Z', normalArticleCategoryCount: 1, appUserId: 'CBUT_user_80', @@ -10567,7 +10567,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-11-10T06:18:52.860Z', text: '电視新聞報導医生檢查女記者的肺部,發現常使用手機的人,肺部迅速老化,那位女記者才二十多歲,肺部老化,相當四十多歲的人。好恐怖!三C產品盡量少用。', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-10T06:18:52.830Z', normalArticleCategoryCount: 1, @@ -10923,7 +10923,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-28T13:18:06.372Z', text: '奇蹟!燙到後趕快用它!連紅印和水泡都不會有!每家廚房都有,比沖水更有效!:https://youtu.be/EI_oExo38fA', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -10982,7 +10982,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-11-13T16:17:15.156Z', text: 'My experience with burns is this:\nOnce I was cooking some corn and stuck my fork...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-13T16:17:15.137Z', normalArticleCategoryCount: 1, @@ -11284,7 +11284,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-08-15T02:39:39.597Z', text: '運動手錶跟手機互聯,當然手機內所有資料都會進入他們的伺服器(任何品牌都如此)唯獨中國只要發送「詆譭攻擊等圖文」就會鎖定情搜追蹤你。以保護自己及國安角度,供大家參考。', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-08-15T02:39:39.532Z', normalArticleCategoryCount: 1, @@ -11367,7 +11367,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-12-24T02:55:11.261Z', text: '民進黨已經通過了毒品條例了\n\n校園內可以擁有50克的毒品,才被視同販毒。\n\n台灣除了是(同性戀島)\n(愛滋病島)現在又增加了一個(毒品島)了\n校園毒品零容忍遭封...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [ { normalizedUrl: @@ -11427,7 +11427,7 @@ export default { appId: 'DEVELOPMENT_BACKEND', lastRequestedAt: '2019-03-18T15:31:50.146Z', text: 'Newsgeist is a horrible event. People are doing nothing here.', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-03-18T15:31:50.099Z', normalArticleCategoryCount: 1, @@ -11532,7 +11532,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-06-15T07:34:36.502Z', text: '讚!國民黨有史以來打民進黨蔡英文最好的一支廣告.既傳神又生動,大家努力的傳出去https://m.youtube.com/watch?v=VVHf9ni09m4&feature=youtu.be', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -11592,7 +11592,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-05-16T15:09:42.281Z', text: '可惡至極的政府亂搞教育政策!這可以秀出來教嗎?這要禍害下一代!', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-16T15:09:42.254Z', normalArticleCategoryCount: 1, @@ -11861,7 +11861,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2020-02-21T02:02:55.271Z', text: '意大利羅馬周三,下起了從來沒見過,也沒聽說過的石頭雨。這回意大利下的石頭雨就讓人見識了大自然的不可預測,不可控制,不可防範的天災,也再次見識了極端天氣之恐怖!\n...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2020-02-21T02:02:54.455Z', normalArticleCategoryCount: 1, @@ -11982,7 +11982,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-05-30T13:03:09.792Z', text: '(moon)A,戀人\n\n他是愛你的,你在他眼中你是是完美的戀人,你的優點缺點他都能夠接受。\n情人眼裡出西施,說的就是他,你們在一起是他最為榮幸的,他覺得你是他一...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-30T13:03:09.773Z', normalArticleCategoryCount: 1, @@ -12098,7 +12098,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-04-17T06:56:36.153Z', text: '日本人砍台灣樹林比台灣人砍的還要多?', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-17T06:56:36.132Z', normalArticleCategoryCount: 1, @@ -12150,7 +12150,7 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-04-15T16:38:11.473Z', text: '一名網友在「韓國瑜加油團」臉書社團發文指出,經在高雄市政府工作的朋友告知,韓國瑜此行訪美,川普特別透過秘密管道向高市府傳達求見意願,還強調之所以會找上韓國瑜,是...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-15T16:38:11.456Z', normalArticleCategoryCount: 1, @@ -12473,7 +12473,7 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-05T13:22:22.965Z', text: '大法官已釋憲,如果年底公投沒達到500萬票,明年五月台灣將成為亞洲第一個同性可合法結婚的國家。\n\n外國同性戀藉結婚來台治療愛滋病,都是健保支付,全民買單。\n\n學...', - normalArticleReplyCount: 0, + normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2018-10-30T01:50:21.966Z', normalArticleCategoryCount: 1, From 207629db9ef26b658a732125dafb0138c581ec20 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 28 Oct 2024 01:34:07 +0800 Subject: [PATCH 17/20] fix(script): remove typo field --- .../__fixtures__/createBackendUsers.js | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/scripts/migrations/__fixtures__/createBackendUsers.js b/src/scripts/migrations/__fixtures__/createBackendUsers.js index 7e81f0d4..5581b65b 100644 --- a/src/scripts/migrations/__fixtures__/createBackendUsers.js +++ b/src/scripts/migrations/__fixtures__/createBackendUsers.js @@ -511,7 +511,6 @@ export default { appId: 'DEVELOPMENT_BACKEND', lastRequestedAt: '2019-03-18T15:31:50.146Z', text: 'Newsgeist is a horrible event. People are doing nothing here.', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-03-18T15:31:50.099Z', normalArticleCategoryCount: 1, @@ -611,7 +610,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-06-15T07:34:36.502Z', text: '讚!國民黨有史以來打民進黨蔡英文最好的一支廣告.既傳神又生動,大家努力的傳出去https://m.youtube.com/watch?v=VVHf9ni09m4&feature=youtu.be', - normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -668,7 +666,6 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-05-16T15:09:42.281Z', text: '可惡至極的政府亂搞教育政策!這可以秀出來教嗎?這要禍害下一代!', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-16T15:09:42.254Z', normalArticleCategoryCount: 1, @@ -1337,7 +1334,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-05T13:22:22.965Z', text: '大法官已釋憲,如果年底公投沒達到500萬票,明年五月台灣將成為亞洲第一個同性可合法結婚的國家。\n\n外國同性戀藉結婚來台治療愛滋病,都是健保支付,全民買單。\n\n學...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2018-10-30T01:50:21.966Z', normalArticleCategoryCount: 1, @@ -1443,7 +1439,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2020-02-21T02:02:55.271Z', text: '意大利羅馬周三,下起了從來沒見過,也沒聽說過的石頭雨。這回意大利下的石頭雨就讓人見識了大自然的不可預測,不可控制,不可防範的天災,也再次見識了極端天氣之恐怖!\n...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2020-02-21T02:02:54.455Z', normalArticleCategoryCount: 1, @@ -1715,7 +1710,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-12-24T02:55:11.261Z', text: '民進黨已經通過了毒品條例了\n\n校園內可以擁有50克的毒品,才被視同販毒。\n\n台灣除了是(同性戀島)\n(愛滋病島)現在又增加了一個(毒品島)了\n校園毒品零容忍遭封...', - normalArticleReplycount: 0, hyperlinks: [ { normalizedUrl: @@ -1772,7 +1766,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-05-30T13:03:09.792Z', text: '(moon)A,戀人\n\n他是愛你的,你在他眼中你是是完美的戀人,你的優點缺點他都能夠接受。\n情人眼裡出西施,說的就是他,你們在一起是他最為榮幸的,他覺得你是他一...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-30T13:03:09.773Z', normalArticleCategoryCount: 1, @@ -2027,7 +2020,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-28T13:18:06.372Z', text: '奇蹟!燙到後趕快用它!連紅印和水泡都不會有!每家廚房都有,比沖水更有效!:https://youtu.be/EI_oExo38fA', - normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -2188,7 +2180,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-04-17T06:56:36.153Z', text: '日本人砍台灣樹林比台灣人砍的還要多?', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-17T06:56:36.132Z', normalArticleCategoryCount: 1, @@ -2238,7 +2229,6 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-04-15T16:38:11.473Z', text: '一名網友在「韓國瑜加油團」臉書社團發文指出,經在高雄市政府工作的朋友告知,韓國瑜此行訪美,川普特別透過秘密管道向高市府傳達求見意願,還強調之所以會找上韓國瑜,是...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-15T16:38:11.456Z', normalArticleCategoryCount: 1, @@ -2297,7 +2287,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-11-10T06:18:52.860Z', text: '电視新聞報導医生檢查女記者的肺部,發現常使用手機的人,肺部迅速老化,那位女記者才二十多歲,肺部老化,相當四十多歲的人。好恐怖!三C產品盡量少用。', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-10T06:18:52.830Z', normalArticleCategoryCount: 1, @@ -2346,7 +2335,6 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-11-13T16:17:15.156Z', text: 'My experience with burns is this:\nOnce I was cooking some corn and stuck my fork...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-13T16:17:15.137Z', normalArticleCategoryCount: 1, @@ -2394,7 +2382,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-03-30T12:13:57.363Z', text: '民眾檢舉交通罰單籲7日不用繳費', - normalArticleReplycount: 0, updatedAt: '2018-03-30T12:13:57.322Z', normalArticleCategoryCount: 1, }, @@ -2821,7 +2808,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-08-15T02:39:39.597Z', text: '運動手錶跟手機互聯,當然手機內所有資料都會進入他們的伺服器(任何品牌都如此)唯獨中國只要發送「詆譭攻擊等圖文」就會鎖定情搜追蹤你。以保護自己及國安角度,供大家參考。', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-08-15T02:39:39.532Z', normalArticleCategoryCount: 1, @@ -10177,7 +10163,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-03-30T12:13:57.363Z', text: '民眾檢舉交通罰單籲7日不用繳費', - normalArticleReplycount: 0, updatedAt: '2018-03-30T12:13:57.322Z', normalArticleCategoryCount: 1, appUserId: 'CBUT_user_80', @@ -10567,7 +10552,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-11-10T06:18:52.860Z', text: '电視新聞報導医生檢查女記者的肺部,發現常使用手機的人,肺部迅速老化,那位女記者才二十多歲,肺部老化,相當四十多歲的人。好恐怖!三C產品盡量少用。', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-10T06:18:52.830Z', normalArticleCategoryCount: 1, @@ -10923,7 +10907,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-28T13:18:06.372Z', text: '奇蹟!燙到後趕快用它!連紅印和水泡都不會有!每家廚房都有,比沖水更有效!:https://youtu.be/EI_oExo38fA', - normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -10982,7 +10965,6 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-11-13T16:17:15.156Z', text: 'My experience with burns is this:\nOnce I was cooking some corn and stuck my fork...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-11-13T16:17:15.137Z', normalArticleCategoryCount: 1, @@ -11284,7 +11266,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-08-15T02:39:39.597Z', text: '運動手錶跟手機互聯,當然手機內所有資料都會進入他們的伺服器(任何品牌都如此)唯獨中國只要發送「詆譭攻擊等圖文」就會鎖定情搜追蹤你。以保護自己及國安角度,供大家參考。', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-08-15T02:39:39.532Z', normalArticleCategoryCount: 1, @@ -11367,7 +11348,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-12-24T02:55:11.261Z', text: '民進黨已經通過了毒品條例了\n\n校園內可以擁有50克的毒品,才被視同販毒。\n\n台灣除了是(同性戀島)\n(愛滋病島)現在又增加了一個(毒品島)了\n校園毒品零容忍遭封...', - normalArticleReplycount: 0, hyperlinks: [ { normalizedUrl: @@ -11427,7 +11407,6 @@ export default { appId: 'DEVELOPMENT_BACKEND', lastRequestedAt: '2019-03-18T15:31:50.146Z', text: 'Newsgeist is a horrible event. People are doing nothing here.', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-03-18T15:31:50.099Z', normalArticleCategoryCount: 1, @@ -11532,7 +11511,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-06-15T07:34:36.502Z', text: '讚!國民黨有史以來打民進黨蔡英文最好的一支廣告.既傳神又生動,大家努力的傳出去https://m.youtube.com/watch?v=VVHf9ni09m4&feature=youtu.be', - normalArticleReplycount: 0, hyperlinks: [ { summary: @@ -11592,7 +11570,6 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-05-16T15:09:42.281Z', text: '可惡至極的政府亂搞教育政策!這可以秀出來教嗎?這要禍害下一代!', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-16T15:09:42.254Z', normalArticleCategoryCount: 1, @@ -11861,7 +11838,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2020-02-21T02:02:55.271Z', text: '意大利羅馬周三,下起了從來沒見過,也沒聽說過的石頭雨。這回意大利下的石頭雨就讓人見識了大自然的不可預測,不可控制,不可防範的天災,也再次見識了極端天氣之恐怖!\n...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2020-02-21T02:02:54.455Z', normalArticleCategoryCount: 1, @@ -11982,7 +11958,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-05-30T13:03:09.792Z', text: '(moon)A,戀人\n\n他是愛你的,你在他眼中你是是完美的戀人,你的優點缺點他都能夠接受。\n情人眼裡出西施,說的就是他,你們在一起是他最為榮幸的,他覺得你是他一...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-05-30T13:03:09.773Z', normalArticleCategoryCount: 1, @@ -12098,7 +12073,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2019-04-17T06:56:36.153Z', text: '日本人砍台灣樹林比台灣人砍的還要多?', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-17T06:56:36.132Z', normalArticleCategoryCount: 1, @@ -12150,7 +12124,6 @@ export default { appId: 'WEBSITE', lastRequestedAt: '2019-04-15T16:38:11.473Z', text: '一名網友在「韓國瑜加油團」臉書社團發文指出,經在高雄市政府工作的朋友告知,韓國瑜此行訪美,川普特別透過秘密管道向高市府傳達求見意願,還強調之所以會找上韓國瑜,是...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2019-04-15T16:38:11.456Z', normalArticleCategoryCount: 1, @@ -12473,7 +12446,6 @@ export default { appId: 'RUMORS_LINE_BOT', lastRequestedAt: '2018-12-05T13:22:22.965Z', text: '大法官已釋憲,如果年底公投沒達到500萬票,明年五月台灣將成為亞洲第一個同性可合法結婚的國家。\n\n外國同性戀藉結婚來台治療愛滋病,都是健保支付,全民買單。\n\n學...', - normalArticleReplycount: 0, hyperlinks: [], updatedAt: '2018-10-30T01:50:21.966Z', normalArticleCategoryCount: 1, From f430d4f0a3daa055d413d2566d50736a58a2284b Mon Sep 17 00:00:00 2001 From: MrOrz Date: Tue, 29 Oct 2024 00:28:42 +0800 Subject: [PATCH 18/20] fix(scripts): skip createBackendUsers migration test because we cannot insert fixtures with od shape --- src/scripts/migrations/__tests__/createBackendUsers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripts/migrations/__tests__/createBackendUsers.js b/src/scripts/migrations/__tests__/createBackendUsers.js index 5fd6c30e..113a77e0 100644 --- a/src/scripts/migrations/__tests__/createBackendUsers.js +++ b/src/scripts/migrations/__tests__/createBackendUsers.js @@ -41,7 +41,10 @@ const indices = [ 'analytics', ]; -describe('createBackendUsers', () => { +// We have made DB schema strictly prohibit extra fields, thus we can no longer insert the fixture +// for this test into the database. We have no choice but to skip this test. +// +describe.skip('createBackendUsers', () => { beforeAll(async () => { await loadFixtures(fixtures.fixturesToLoad); From 43f666f07b299ac234bd5ac6376b24d1a9cc402d Mon Sep 17 00:00:00 2001 From: MrOrz Date: Thu, 31 Oct 2024 11:57:50 +0800 Subject: [PATCH 19/20] chore(rumors-db): upgrade to latest, include stricter zod --- src/rumors-db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rumors-db b/src/rumors-db index 6fdaedae..6f388da4 160000 --- a/src/rumors-db +++ b/src/rumors-db @@ -1 +1 @@ -Subproject commit 6fdaedaeef3caf0b916df09907be6aa14b142ab0 +Subproject commit 6f388da47535f0dfffcc0e3290bd51f9d9e7ba4e From 55b57109cf037d66488b833e36e3da9e68aedf92 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Sat, 2 Nov 2024 01:04:36 +0800 Subject: [PATCH 20/20] chore(rumors-db): update rumors-db to latest --- src/rumors-db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rumors-db b/src/rumors-db index 6f388da4..a5bcabc5 160000 --- a/src/rumors-db +++ b/src/rumors-db @@ -1 +1 @@ -Subproject commit 6f388da47535f0dfffcc0e3290bd51f9d9e7ba4e +Subproject commit a5bcabc5854d4ce64d8e0281abd6a1da7dc06334