nylas/nylas-ruby

account_id nil on delta converted to message model

Closed this issue · 7 comments

Hello,
Looks like there is a bug here when converting a delta to a message model:

(object_attributes || {}).merge(id: id, account_id: account_id)

There is no account_id property on the create message delta json as you can see in the examples in the docs: https://docs.nylas.com/docs/deltas-overview#deltas-response-examples. So, when merging account_id onto object_attributes, account_id gets set to nil on the message model. account_id is not nil on object_attributes, however; so it seems that attribute should be used.

Hey @sudall thanks for reporting it. I was looking at the docs and found that response do have an account_id under deltas. Can you please check and see if this still an issue for you? Also if it's still an issue please provide a sample code or snippet to reproduce this. thanks.

Closing this for now. Please reopen this if still an issue. Thanks.

Apologies if this was unclear, but I believe this is still an issue. There is no account_id property for deltas one level deep into the object (only cursor, event, id, and object). There is an account_id on the attributes property (which appears to be represented by object_attributes in the Delta model).

OK I can see this now. I am going to reopen this and will try to replicate the problem and will revert back. thanks

@sudall I have done few changes in a branch and to me they look ok. Can you see if that solves this problem? https://github.com/nylas/nylas-ruby/compare/fix-delta-account-id

We have merged #297 to fix problems with delta. Can you please check with latest master and see if things are working ok? thanks

This has been taken care in #297