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

KeyError in fetchThreadList() #335

Closed
2FWAH opened this issue Sep 21, 2018 · 2 comments
Closed

KeyError in fetchThreadList() #335

2FWAH opened this issue Sep 21, 2018 · 2 comments

Comments

@2FWAH
Copy link
Contributor

2FWAH commented Sep 21, 2018

Description of the problem

Fetching threads using fetchThreadList() failed with KeyError.

Method works if no group threads are in ThreadLocation (given as parameter, default to INBOX) but fails if there is at least one group thread (may be related if the user is admin or not of the thread conversation).

Code to reproduce

Try to fetch threads using fetchThreadList().

Traceback

>>> client.fetchThreadList()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fb/fbchat/fbchat/client.py", line 895, in fetchThreadList
    return [graphql_to_thread(node) for node in j['viewer']['message_threads']['nodes']]
  File "/home/fb/fbchat/fbchat/client.py", line 895, in <listcomp>
    return [graphql_to_thread(node) for node in j['viewer']['message_threads']['nodes']]
  File "/home/fb/fbchat/fbchat/graphql.py", line 246, in graphql_to_thread
    return graphql_to_group(thread)
  File "/home/fb/fbchat/fbchat/graphql.py", line 306, in graphql_to_group
    approval_requests = set(node["requester"]['id'] for node in group['group_approval_queue']['nodes']),
KeyError: 'group_approval_queue'

Environment information

  • Python 3.5.3
  • Master branch (08117e7)

Looks related to the recent support for rooms.

@kapi2289
Copy link
Contributor

Ohh, that's my fault, I'll fix this!

@madsmtm
Copy link
Member

madsmtm commented Sep 27, 2018

Closed by #340, I'll release a new version later today ;)

@madsmtm madsmtm closed this as completed Sep 27, 2018
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

3 participants