draftbit / twitter-lite

A tiny, full-featured, flexible client / server library for the Twitter API
https://npm.im/twitter-lite
MIT License
794 stars 96 forks source link

Id overflow in 'followers/ids' Endpoint #122

Closed amiralitaheri closed 3 years ago

amiralitaheri commented 4 years ago

Converting response to json in _handleResponse function causes overflow, and Ids become invalid. Correct json

{
    "ids": [
        6666286963965050880,
        666355086822674434,
    ],
    "next_cursor": 0,
    "next_cursor_str": "0",
    "previous_cursor": 0,
    "previous_cursor_str": "0",
    "total_count": null
}

Wrong json

{
    "ids": [
        6666286963965051000,
        666355086822674400,
    ],
    "next_cursor": 0,
    "next_cursor_str": "0",
    "previous_cursor": 0,
    "previous_cursor_str": "0",
    "total_count": null
}
dandv commented 4 years ago

Have you read the README section about numeric vs string IDs?

If you can still reproduce the problem, please add a test case like this.

amiralitaheri commented 4 years ago

@dandv
Sorry I didn't saw that, but isn't it better to add stringify_ids: true by default? since numeric ids are useless.