GithubHelp home page GithubHelp logo

Comments (16)

brenoferreira avatar brenoferreira commented on May 30, 2024

I'm getting this same error here. Taking a quick look at the source code, I think it's missing an "Accept-Encoding" or "Content-Encoding" Headers (set to utf-8) in the webResource object in the insertEntity function of TableService. It's just a guess. I'll run some tests here and see if I can figure it out.

from azure-sdk-for-node.

brenoferreira avatar brenoferreira commented on May 30, 2024

I've been trying to find the problem but until now, no success. I've traced the request data (including headers and content), and everything seems to be ok.
During my tests, I found out that when inserting items in batch when there's some unicode values, it says the entities were inserted, when in fact, they weren't. I'll keep trying to find what's wrong.

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

Could you provide a test case which reproduces the problem reliably?

from azure-sdk-for-node.

brenoferreira avatar brenoferreira commented on May 30, 2024

I've created a gist with a code example you can use to reproduce: https://gist.github.com/1672240

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

Awesome, I'll give it a go.

from azure-sdk-for-node.

brenoferreira avatar brenoferreira commented on May 30, 2024

Great! I'll keep trying to find something here!

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

Alright, I've found the issue. Now I just need to find a place to charge my laptop before figuring out how to patch.

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

Right, the issue is the content length set for all the xml data. It should be byte length, not char length.

See all the xml sending methods in tableservice.js. They will be setting it such as:

  webResource.addOptionalHeader(HeaderConstants.CONTENT_LENGTH, entityXmlDescriptor.length);

The fix is to replace all of these with:

  webResource.addOptionalHeader(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(entityXmlDescriptor, 'utf8'));

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

I'd be happy to send a pullreq, but will have to find a power source first.

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

Feel free to try my fork, at https://github.com/einaros/azure-sdk-for-node .. it should be fixed there. I haven't run the test cases yet, though, so no pullreq.

from azure-sdk-for-node.

andrerod avatar andrerod commented on May 30, 2024

Great stuff @einaros ! Your fix is absolutely correct. When you can just generate the pul request and ill accept it.

Thanks
Andre

from azure-sdk-for-node.

brenoferreira avatar brenoferreira commented on May 30, 2024

Awesome @einaros ! It totally makes sense.

Thank you so much!
Breno

from azure-sdk-for-node.

brenoferreira avatar brenoferreira commented on May 30, 2024

I've been looking at the source code, and I think this problem seems to be present in some other modules as well, such as the QueueService and BlobService.

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

It is. I've started writing test cases and fixes for the other pieces too.

from azure-sdk-for-node.

einaros avatar einaros commented on May 30, 2024

There we go. Updated the pullreq.

from azure-sdk-for-node.

andrerod avatar andrerod commented on May 30, 2024

This is now fixed in the dev branch.

from azure-sdk-for-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.