Skip to content
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

3386 - make sure oembed_json is a Hash #376

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

vasconsaurus
Copy link
Contributor

@vasconsaurus vasconsaurus commented Aug 17, 2023

Description

We sometimes get an error when parsing the oembed: TypeError: no implicit conversion of String into Integer

This happens with similar specific urls, all weirdly named urls with .top domain. Those sites return '404' on their response.body, when we JSON.parse it, it returns an integer, which breaks things.

This was fixed by returning early if the value is not a Hash.

References: 3386

How has this been tested?

Tested parsing some of the urls that were causing this error. (there are some examples on the ticket)

in a few specific cases our oembed_json was returning an integer,
which was an unexpected return, thus breaking things. by returning early,
we return nil, something we can deal with.
@vasconsaurus vasconsaurus marked this pull request as ready for review August 17, 2023 21:13
Copy link
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

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

Pretty straightforward :)

@vasconsaurus
Copy link
Contributor Author

Two facebook tests failed. I think there is some flakiness going on with the facebook tests. I don't think the failures are related to this change.

@vasconsaurus vasconsaurus merged commit 64051bd into develop Aug 17, 2023
3 of 4 checks passed
@vasconsaurus vasconsaurus deleted the fix-3386-type-error-oembed-item branch August 17, 2023 21:18
@sentry-io
Copy link

sentry-io bot commented Aug 23, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: no implicit conversion of String into Integer Api::V1::MediasController#index View Issue

Did you find this useful? React with a 👍 or 👎

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