fbchat-dev / fbchat-dev/fbchat

fetchThreadList error due to unknown thread type: MARKETPLACE

Open
#408 5 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

## Description of the problem
fetchThreadList fails when a Marketplace thread type is returned (e.g. when you click on "Message Seller" in a "Buy and Sell" group).

## Code to reproduce
```py
# Example code
from fbchat import Client
client = Client("[REDACTED_USERNAME]", "a_password_with_%")
client.fetchThreadList()
```

## Traceback
```
Traceback (most recent call last):
File "/.../fbchat/_client.py", line 1161, in fetchThreadList
graphql_to_thread(node) for node in j["viewer"]["message_threads"]["nodes"]
File "/.../fbchat/_client.py", line 1161, in
graphql_to_thread(node) for node in j["viewer"]["message_threads"]["nodes"]
File "/.../fbchat/_graphql.py", line 493, in graphql_to_thread
thread.get("thread_type"), thread
fbchat._exception.FBchatException: Unknown thread type: MARKETPLACE, with data: {...}
```

## Environment information
- Python version 3.7.0
- `fbchat` version 1.6.4

I added a elif clause to `graphql_to_thread` to avoid an interruption and still retrieving the others GROUP/ONE_TO_ONE threads

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.