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 web users cannot submit reply requests #264

Closed MrOrz closed 2 years ago

MrOrz commented 2 years ago

Issue: website users cannot submit reply requests in release tests.

Root cause: in #263 we use user.id and user.appId in GraphQL context instead of from GraphQL context, for several APIs including CreateOrUpdateReplyRequest.

However, website users actually do not have user.appId, as it is a new field.

This PR fixes the bug by making the utility function createOrUpdateUser always fill in appId for web users.

Note: this PR does not change the registration process via passport.js. Therefore, new website users still do not have appId in its users document as before.

coveralls commented 2 years ago

Coverage Status

Coverage decreased (-0.1%) to 86.142% when pulling 6050df3fc4af6a2232df6192195fc9598ac42b0f on fix-mutation into be0d9b99f7cb636d60a57a9951623c64c7101133 on master.