-
Notifications
You must be signed in to change notification settings - Fork 859
Fix where client_id
is returning null
and throwing a TypeError
#4920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix where client_id
is returning null
and throwing a TypeError
#4920
Conversation
…present as the client_id is necessary for getting the contribution activity
client_id
is returning null
and throwing a TypeError
client_id
is returning null
and throwing a TypeError
Size Change: +5 B (0%) Total Size: 6.87 MB ℹ️ View Unchanged
|
…ault values for client_id which defaults to null to prevent TypeError being thrown
session: { | ||
user: { client_id }, | ||
}, | ||
session: { user: { client_id = null } = {} } = {}, | ||
params: { id }, | ||
} = request | ||
await this.model.db.createSkippedSentence(id, client_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw 400 here, since we need the client_id to create a meaningful entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming this is addressed in commit 38fcf9d
…return to 400 response in createLanguageRequest()
Co-authored-by: Dmitrij Feller <119537889+moz-dfeller@users.noreply.github.com>
Co-authored-by: Dmitrij Feller <119537889+moz-dfeller@users.noreply.github.com>
Confirming I have addressed all the review comments, and the additional one we chatted about just now, @moz-dfeller. Now sending for review again. |
client_id
is returning null
and throwing a TypeError
client_id
is returning null
and throwing a TypeError
Pull Request Form
Type of Pull Request
Related Sentry errors and files modified
Link to error in Sentry
TypeError Cannot destructure property 'client_id' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined.
srv/src/lib/api.ts
in functionGetContributionActivity
Link to error in Sentry
TypeError Cannot read properties of undefined (reading 'client_id')
/code/server/src/lib/clip.ts
inClip.saveClip
at line 198:17Link to error in Sentry
TypeError Cannot read properties of undefined (reading 'client_id')
/code/server/src/lib/api.ts
inAPI.createSkippedSentence
at line 276:17Link to error in Sentry
Cannot set headers after they are sent to the client
/code/server/src/lib/clip.ts
inserveClipLeaderboard
at line 413Acknowledging contributors