fix: treat Puppeteer session cookies as valid in Instagram_cookiesExist#100
Merged
David-patrick-chuks merged 5 commits intoJun 21, 2026
Conversation
Session cookies saved by Puppeteer use expires -1, which was incorrectly treated as expired and forced unnecessary credential logins.
a296d9c to
2976259
Compare
Owner
|
Thanks for this contribution! This PR currently has merge conflicts with git fetch origin
git checkout fix/instagram-session-cookie-expiry
git rebase origin/main
# resolve conflicts, then:
git add .
git rebase --continue
git push --force-with-leaseOnce conflicts are resolved and CI is green, this will be ready for review/merge. |
- Fix missing closing brace in withFileLock function that caused parsing error - Remove duplicate isCookieValid definitions - Add eslint.config.js for ESLint v9+ compatibility - Ensure isCookieValid properly handles session cookies with expires=-1
Contributor
Author
|
Hi Maintainer. Kindly review the PR . |
…bility - Updated lint script: 'eslint src --ext .ts' -> 'eslint src' - Updated lint:fix script: 'eslint src --ext .ts --fix' -> 'eslint src --fix' - ESLint v9+ no longer supports the --ext flag - File patterns are now defined in eslint.config.js
- Format eslint.config.js - Format src/utils/index.test.ts
Contributor
Author
|
Hi Maintainer, Please review the changes |
5723201
into
David-patrick-chuks:main
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Instagram_cookiesExist()so Puppeteer session cookies (expires: -1) are recognized as valid instead of treated as expiredisCookieValid()helper and unit tests covering session, expired, and future timed cookiesProblem
Puppeteer marks session cookies with
expires: -1. The previous check only accepted cookies whereexpires > currentTimestamp, so valid saved sessions were skipped and the IG client fell back to credential login on every run.Test plan
npm test— all 27 tests pass (4 new cookie validation tests)expires: -1) returns true fromInstagram_cookiesExist()Made with Cursor