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

[BUG]: Bot responds to LinkedIn Messages - repeatedly #898

Open
shunte88 opened this issue Nov 21, 2024 · 1 comment
Open

[BUG]: Bot responds to LinkedIn Messages - repeatedly #898

shunte88 opened this issue Nov 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shunte88
Copy link

shunte88 commented Nov 21, 2024

Describe the bug

I've been running the bot for a week and have gotten several responses from potential employers.

When employers reach out through LI messages to arrange phone screens etc the message popup appears to be coming into focus in the bot session, the bot will intermittently find response buttons and click them; many many times.
Not only an annoying bug but its sending a very odd impression to a prospective employer.

botcrazy

Steps to reproduce

In the bot window open a message conversation that has response buttons, example buttons
[I'm Interested] [Thank You] [I'm Busy]
Just let the bot run and observe the mayhem

Expected behavior

The bot should not be responding to the message pane, the message pane should be ignored, if not totally off limits

Actual behavior

An embarrassing mess

Branch

None

Branch name

No response

Python version

3.12

LLM Used

chatGPT

Model used

gpt 4o

Additional context

No response

@shunte88 shunte88 added the bug Something isn't working label Nov 21, 2024
@shunte88
Copy link
Author

Inspected the source for these conversation shortcuts but the tests around click would appear to negate the possibility of them being clicked.
Walking the logs I did find tests for resume/cover letter that reference the upload buttons in the conversation pane and I added a quick test for these exposed options. The prompt call looks for one or other of the resume/cover responses - a response is always returned irrespective of it being in context or not.
I don't see attachments on the conversation but the log entries where uploads are attempted are in lockstep with the posted conversation responses.
Added the quick string test to save on prompt calls and the potential for the erroneous conversation responses.

I have the bot running now and will monitor going forward

    def _handle_upload_fields(self, element: WebElement, job) -> None:
        def check_not_message_popup(phrase):
            for _ in ['an image', 'a file']:
                if f'attach {_} to your conversation with' in phrase:
                    return False
            return True

        logger.debug("Handling upload fields")

        try:
            show_more_button = self.driver.find_element(By.XPATH,
                                                        "//button[contains(@aria-label, 'Show more resumes')]")
            show_more_button.click()
            logger.debug("Clicked 'Show more resumes' button")
        except NoSuchElementException:
            logger.debug("'Show more resumes' button not found, continuing...")

        file_upload_elements = self.driver.find_elements(By.XPATH, "//input[@type='file']")
        for element in file_upload_elements:
            parent = element.find_element(By.XPATH, "..")
            self.driver.execute_script("arguments[0].classList.remove('hidden')", element)
            clickable = parent.text.lower()
            if check_not_message_popup(clickable):
                output = self.gpt_answerer.resume_or_cover(clickable)
                if 'resume' in output:
                    logger.debug("Uploading resume")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant