Skip to content

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Jan 22, 2024

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 the inviter and invitee relationships, which are then used to display the inviter name on https://crates.io/me/pending-invites.

Best reviewed commit-by-commit.

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... 😅
@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-frontend 🐹 labels Jan 22, 2024
Copy link
Contributor

@LawnGnome LawnGnome left a 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.

@Turbo87
Copy link
Member Author

Turbo87 commented Jan 23, 2024

I'm obviously blissfully ignorant of the finer implications of how Ember works internally

*Ember Data 😉

@Turbo87 Turbo87 merged commit 50aa541 into rust-lang:main Jan 23, 2024
@Turbo87 Turbo87 deleted the fix-inviter-column branch January 23, 2024 05:47
@bors bors mentioned this pull request Jan 23, 2024
1 task
@LawnGnome
Copy link
Contributor

*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.)

@Turbo87
Copy link
Member Author

Turbo87 commented Jan 24, 2024

Hahaha, it is an official package, but it's optional and you can just as well use fetch directly or GraphQL or whatever :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants