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

Incorrect Types for height an width in OpenGraphData Model #247

Open
3 of 6 tasks
harsh-verma-jtg opened this issue Mar 15, 2023 · 3 comments
Open
3 of 6 tasks

Incorrect Types for height an width in OpenGraphData Model #247

harsh-verma-jtg opened this issue Mar 15, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@harsh-verma-jtg
Copy link

harsh-verma-jtg commented Mar 15, 2023

Describe the bug
I'm currently trying to fetch open graph data from an URL as mentioned in stream_feed's documentation we can use
client.og(previewUrl) method to fetch open graph data https://getstream.io/activity-feeds/docs/flutter-dart/open_graph_scraping/?language=dart&q=client.og
If I look inside the OpenGraphData model the height and width property of OgImage and OgVideo model are marked as String? type but in the API response both values are of integer type due to which whenever there is a height and width value received in API response error is thrown while parsing those due to type mismatch.
Here is the log of the error
_message: "Expected a value of type 'String?', but got one of type 'int'"

Screenshot from 2023-03-15 15-11-53
Screenshot from 2023-03-15 13-28-15

What version of Flutter do you use?
3.7.0

What package are you using? What version?
stream_feed_flutter_core

What platform is it about?

  • Android
  • iOS
  • Web
  • Windows
  • MacOS
  • Linux

To Reproduce
Try to fetch metadata of URLs which have height and width property in response
one example for it is https://google.com

Expected behavior

There should be consistency between API response and models created on frontend, most probably height and width should be of type int? so changes most probably be needed on frontend side to fix the issue

Screenshot from 2023-03-15 20-16-45

@harsh-verma-jtg harsh-verma-jtg added the bug Something isn't working label Mar 15, 2023
@harsh-verma-jtg
Copy link
Author

Possible Fix would be correcting type of width and height in OpenGraphModel
using int? width, and int? height instead of String? height, String? width.

Screenshot from 2023-03-16 13-29-41

@followthemoney1
Copy link

@hdiogenes @jeroenleenarts @gumuz @tbarbugli are there any updates planning on the plugin? There was 11 month or inactivity

@tayormi
Copy link

tayormi commented Dec 15, 2023

i don’t think there’s any plan for updates to this package, even though we depend on it. I probably will create a fork out of this for what I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants