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

Can't serialize objects #24

Open
Thomas-Fleming opened this issue May 13, 2016 · 8 comments
Open

Can't serialize objects #24

Thomas-Fleming opened this issue May 13, 2016 · 8 comments

Comments

@Thomas-Fleming
Copy link
Contributor

Many of the objects use a struct called Isset in the Evernote.EDAM.Type namespace. However, these types are different depending on which type they are nested in e.g. Evernote.EDAM.Type.Notebook and Evernote.EDAM.Type.Note both contain an Isset struct. This name clash prevents these object from being serialized correctly.

@mpnow
Copy link
Contributor

mpnow commented May 13, 2016

Yeah - I'm pretty sure that's a function of the underlying Evernote API, not sure there's anything that can be done about it in the Windows SDK.

@Thomas-Fleming
Copy link
Contributor Author

There's an interesting discussion about a similar problem here: https://issues.apache.org/jira/browse/THRIFT-1964

Sounds like they solved it by not serializing the Isset fields since they are derived from the data in the actual object. Rather than using public fields we could use public properties whose values are derived from the data, though I'm not convinced this is a good idea / would work.

@mpnow
Copy link
Contributor

mpnow commented May 14, 2016

Good find. So my assessment was close - it looks like the issue is in the Thrift code generator. It looks like they patched Thrift there to resolve it; if so, if you were to re-generate the .NET Thrift assembly, it should include the fix?

@Thomas-Fleming
Copy link
Contributor Author

Do you mean regenerate the .Net Thrift assembly, or use the latest .Net Thrift assembly to re-generate the types in the Evernote assembly (the assembly containing the Evernote.EDAM.Type namespace)?

If the latter, I'm not familiar with Thrift. Are you able to do this?

@mpnow
Copy link
Contributor

mpnow commented Jul 8, 2016

I meant the latter, sorry for the ambiguity. Alas I've never generated anything with Thrift, either; I've just used the assemblies that the Evernote engineering team has generated.

@Thomas-Fleming
Copy link
Contributor Author

Any idea who we can ask to regenerate those assemblies?

@Thomas-Fleming
Copy link
Contributor Author

Update:

At this point I have to ask, should we be doing this or Evernote Corp? Evernotes website points developers to github for support (https://stackoverflow.com/questions/tagged/evernote) but that appears to be a ghost town with almost no replies.

If we do generate our own C# from the Thrift IDL, are you okay with replacing the official binary that's currently included with an additional project consisting of the auto-generated code? Assuming you are, what thrift compiler options should be specified? Options are:

csharp (C#):
async: Adds Async support using Task.Run.
asyncctp: Adds Async CTP support using TaskEx.Run.
wcf: Adds bindings for WCF to generated classes.
serial: Add serialization support to generated classes.
nullable: Use nullable types for properties.
hashcode: Generate a hashcode and equals implementation for classes.
union: Use new union typing, which includes a static read function for union types.

@akhaku
Copy link
Contributor

akhaku commented Jul 20, 2016

Hi, sorry, you're absolutely right, Evernote should be the one doing this. Developer support has fallen by the wayside a bit of late, that's our fault. We have an initiative underway to get our act together where it comes to the developer community, part of that roadmap is to update the developer API reference and SDKs. Might need some help from you guys to test a few things since we're a bit short on C# resources at the moment, stay tuned!

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