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

AsyncVkExecuteRequestPool wall.get method messing up 'groups' array #55

Open
Shmookoff opened this issue Aug 30, 2021 · 0 comments
Open

Comments

@Shmookoff
Copy link

Shmookoff commented Aug 30, 2021

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..?

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

1 participant