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

Update one custom field on a ticket forces all the other custom fields to be posted in API request #343

Open
taonic opened this issue Sep 1, 2017 · 0 comments

Comments

@taonic
Copy link

taonic commented Sep 1, 2017

>> ticket.changes
=> #<ZendeskAPI::SilentMash>
>> ticket.fields.last.value = 'new value'
=> "new value"
>> ticket.changes
=> #<ZendeskAPI::SilentMash fields=#<Hashie::Array [#<ZendeskAPI::Trackie id=10002 value="">, #<ZendeskAPI::Trackie id=10356 value=nil>, #<ZendeskAPI::Trackie id=10361 value=nil>, #<ZendeskAPI::Trackie id=10366 value=false>, #<ZendeskAPI::Trackie id=10371 value=nil>, #<ZendeskAPI::Trackie id=10376 value="">, #<ZendeskAPI::Trackie id=10381 value=nil>, #<ZendeskAPI::Trackie id=10386 value=nil>, #<ZendeskAPI::Trackie id=10391 value=nil>, #<ZendeskAPI::Trackie id=10396 value="test test">, #<ZendeskAPI::Trackie id=10401 value="To Do">, #<ZendeskAPI::Trackie id=10406 value="">, #<ZendeskAPI::Trackie id=10411 value=nil>, #<ZendeskAPI::Trackie id=10416 value="new value">]>>

I suspect this is to do with this line where the entire array (contains fields) is marked as dirty when any element in the array is changed. This behaviour leads to the api client to post all the fields to the endpoint, and potentially overwrite other fields due to race conditions.

This can be a surprise when the expectation is only the diff (changed attributes) should be posted back.

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

1 participant