Skip to content

Allow empty string for profile image URL - #22

Open
Syfaro wants to merge 2 commits into
jpopesculian:masterfrom
Syfaro:allow-empty-url
Open

Allow empty string for profile image URL#22
Syfaro wants to merge 2 commits into
jpopesculian:masterfrom
Syfaro:allow-empty-url

Conversation

@Syfaro

@Syfaro Syfaro commented Nov 28, 2022

Copy link
Copy Markdown
Contributor

This is a bit of a weird issue and I'm not entirely sure this is the best way to solve it. Essentially, some users have a profile_image_url that's an empty string, not null, and that obviously can't be deserialized to a url::Url. This adds a custom function for deserializing that converts empty strings to None, and continues to parse non-empty strings to a url::Url. I've loaded tens of thousands of profiles with these changes and it seems to fix the issue.

@jpopesculian jpopesculian left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! just a nitpick (:

Comment thread src/data/user.rs Outdated
@Syfaro

Syfaro commented Nov 29, 2022

Copy link
Copy Markdown
Contributor Author

Making it generic was a good idea! And thanks for the pointer on where to put it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants