-
Notifications
You must be signed in to change notification settings - Fork 623
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 "Invited by" column #7982
Fix "Invited by" column #7982
Conversation
Previously, the `normalizeResponse()` implementation was throwing away the `users` array in the payload, because of a "missing id" issue (see rust-lang#3490). The root cause for that however was not that the `id` field in the `user` objects was missing (it actually exists), but that the `modelNameFromPayloadKey()` implementation was unconditionally returning `'crate-owner-invite'` even for `user` payloads. This change fixes the `modelNameFromPayloadKey()` implementation to be compatible with `user` payloads and removes the now obsolete `normalizeResponse()` implementation.
…ited_by_username` field `invited_by_username` isn't actually sent anymore by the v2 (aka. `private`) API and it had been showing an empty column for 14 months now... 😅
`invited_by_username` isn't actually sent anymore by the v2 (aka. `private`) API and it had been showing an empty column for 14 months now... 😅
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.
I'm obviously blissfully ignorant of the finer implications of how Ember works internally, but makes intuitive sense to me.
Sorry, I mean, it makes ${sense}_id
to me.
*Ember Data 😉 |
See how blissful I am? (The funny part is that I actually wrote Ember Data to start with, then Googled it, and convinced myself it was just part of Ember.) |
Hahaha, it is an official package, but it's optional and you can just as well use fetch directly or GraphQL or whatever :) |
The "Invited by" column on https://crates.io/me/pending-invites has not shown any content for the past 14 months (since #5501 was merged and deployed).
When working on the migration back then, I missed that the new API endpoint does not contain the
invited_by_username
field anymore, but our frontend template was still using that field.This PR removes the
invited_by_username
field from the corresponding Ember Data model and replaces it with theinviter
andinvitee
relationships, which are then used to display the inviter name on https://crates.io/me/pending-invites.Best reviewed commit-by-commit.