-
Notifications
You must be signed in to change notification settings - Fork 61
Cannot properly parse id's returned by taobao.tmc.messages.consume (TmcMessage) #8
Comments
I think the best way is tell TOP this issue and let them return a new property is_str like weibo API does. |
Makes sense to me. Will open a ticket there. Don't know if will change though :-). Thanks for the great package. |
Can you upload a json result for this issue, I want to wrap this issue
|
Not sure if I understand what's needed. Let me know if this is not helpful. Sorry, I'm new to to JavaScript. This is the parsed results. The id property is the integer that's too long and rounded down. {
tmc_messages_consume_response: {
messages: {
tmc_message: [
{user_id: 123456789,
user_nick: 'usernick',
content: '{"nick":"usernick","increment":1,"num":502,"changed_fields":"num","num_iid":15380658823}',
id: 7104300007405429000,
pub_time: '2013-10-05 10:55:58',
pub_app_key: '12499723',
topic: 'taobao_item_ItemStockChanged' }
]
}
}
} JSON string
|
@lukewarm I fix this on top@0.2.0 , change Long Number id property to String id. |
Awesome man! Will post any updates here when TOP responds to the request of a string id. |
This is not exactly an issue of the package. But as is, it cannot parse ids from TOP's message service. The ids are integers too large for JavaScript's int. As a result, the built-in JSON.parse rounds down the numbers. E.g.
7091800003790954036 -> 7091800003790954000
I'm using a custom parser as a work-around for this api only, but don't know the performance implications.
The text was updated successfully, but these errors were encountered: