import json


def is_state_message(line: str) -> bool:
    """
    Detects if a string is a validstate message
    """
    try:
        json_object = json.loads(line)
        return 'bookmarks' in json_object
    except Exception:
        return False