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

Field specified more than once #113

Open
apa512 opened this issue Oct 29, 2020 · 4 comments
Open

Field specified more than once #113

apa512 opened this issue Oct 29, 2020 · 4 comments

Comments

@apa512
Copy link

apa512 commented Oct 29, 2020

Which SDK version are you using?

0.8.0.0

What's the issue?

Many different operations lead to an object with some kind of messed up state.

Steps/Sample code to reproduce the issue

ad = FacebookAds::Ad.get("123", session)
ad.status = "ACTIVE"
ad.save
ad.status

Observed Results:

FacebookAds::ClientError (Syntax error "Field status specified more than once. This is only possible before version 2.1" at character 34: id,configured_status,status,status:  (fbtrace_id: hidden))

Expected Results:

I expect to see "ACTIVE".

Any idea what I'm doing wrong?

@ericzou
Copy link

ericzou commented May 20, 2021

same issue here for attribution_spec. looks like adset.__all_fields contains both symbol and strings for the same key after save.. e.g. #<Set: {:id, :attribution_spec, :name, "attribution_spec"}>

@ericzou
Copy link

ericzou commented May 20, 2021

dug a bit more. it seems that the following line is converting the symbol to string.

      def define_writer(name)
        define_method("#{name}=") do |val|
          changes[name] = val
          @__all_fields.add(name.to_s) <--- 
        end
      end

@stale
Copy link

stale bot commented Jan 8, 2022

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 8, 2022
@peylun
Copy link

peylun commented Jan 30, 2023

👋 Any update on this issue?
I am encountering the same error when trying to save values on different level objects. Oddly even though it returns error on save, the value managed to get persisted; occasionally it manages to save successfully, but accessing the value after reload! returns the same error.

Examples

  • Updating adset.name (no error on save; error on adset.name after saving)
    image

  • Updating adset.targeting (error on save and adset.targeting after saving)
    image

  • Similar errors on ad.creative update & save, capaign.daily_budget update & save

@stale stale bot removed the Stale label Jan 30, 2023
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

No branches or pull requests

3 participants