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

AdImage IDs lead to invalid URI generation #23

Closed
stex opened this issue Aug 20, 2017 · 4 comments
Closed

AdImage IDs lead to invalid URI generation #23

stex opened this issue Aug 20, 2017 · 4 comments
Labels

Comments

@stex
Copy link

stex commented Aug 20, 2017

AdImage IDs seem to consist of the account ID and the image hash with a colon as separator.
This leads to URI::InvalidURIError exceptions when trying to load the resource by its ID.

A minimum example:

image = FacebookAds::AdAccount.get('act_12345678').adimages.first
image.hash
# => "feb391c9e7045348b52ef2081ed22830"

image.reload! # everything except the ID is cleared
image.hash
#=> URI::InvalidURIError: bad URI(is not URI?): 12345678:feb391c9e7045348b52ef2081ed22830
@mantas
Copy link

mantas commented Oct 12, 2017

@stex did you figure this out yet?

@stex
Copy link
Author

stex commented Oct 13, 2017

@mantas I didn't have much time yet to search for a proper solution that would involve altering this gem, so I went with the most suboptimal one for now (that will most likely kill your API quota quickly):

@account.adimages(fields: ...).find { |i| i.hash == id }

@stale
Copy link

stale bot commented Jan 14, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jan 14, 2020
@stale
Copy link

stale bot commented Jan 21, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants