aiovk icon indicating copy to clipboard operation
aiovk copied to clipboard

AsyncVkExecuteRequestPool wall.get method messing up 'groups' array

Open Shmookoff opened this issue 3 years ago • 0 comments

AsyncVkExecuteRequestPool wall.get method with extended=1 adds 'groups' elements from previous call to the next.

Code:

import aiovk
from aiovk.pools import AsyncVkExecuteRequestPool

async def f():
    pool = AsyncVkExecuteRequestPool()
    resp = pool.add_call('wall.get', token, {'owner_id': -29534144, 'count': 1, 'extended': 1, 'v': '5.130'})
    resp1 = pool.add_call('wall.get', token, {'owner_id': -125004421, 'count': 1, 'extended': 1, 'v': '5.130'})
    await pool.execute()
    print(resp.result['groups'])
    print(resp1.result['groups'])

if __name__ == '__main__':
    asyncio.run(f())

Output: https://pastebin.com/RP9A4d42 The output from https://vk.com/dev/wall.get for the second owner_id: image

Whereas if I switch calls' places:

import asyncio
import aiovk
from aiovk.pools import AsyncVkExecuteRequestPool

async def f():
    pool = AsyncVkExecuteRequestPool()
    resp1 = pool.add_call('wall.get', token, {'owner_id': -125004421, 'count': 1, 'extended': 1, 'v': '5.130'})
    resp = pool.add_call('wall.get', token, {'owner_id': -29534144, 'count': 1, 'extended': 1, 'v': '5.130'})
    await pool.execute()
    print(resp1.result['groups'])
    print(resp.result['groups'])

if __name__ == '__main__':
    asyncio.run(f())

the output would be https://pastebin.com/772TRsUX But using the https://vk.com/dev/wall.get image

or is it supposed to work that way..?

Shmookoff avatar Aug 30 '21 02:08 Shmookoff