mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(session-pool): round-robin fingerprints in SessionFactory
createSession() used rotator.random() despite its docstring saying 'next available fingerprint'. Random draws collide in a small profile pool, producing duplicate fingerprints (and duplicate sess-<fp>-<ms> ids) across a warm pool — flaky tests and look-alike sessions. Switch to rotator.next() so each pooled session gets a distinct fingerprint, as documented.
This commit is contained in:
@@ -25,7 +25,10 @@ export class SessionFactory {
|
||||
* would involve Playwright browser automation.
|
||||
*/
|
||||
createSession(): Session {
|
||||
const fingerprint = this.rotator.random();
|
||||
// Round-robin so each session in a warm pool gets a distinct fingerprint
|
||||
// (a pool of look-alike sessions defeats the purpose). The rotator still
|
||||
// exposes random() for callers that want unpredictability over time.
|
||||
const fingerprint = this.rotator.next();
|
||||
return new Session(
|
||||
fingerprint,
|
||||
this.config.cooldownBase,
|
||||
|
||||
Reference in New Issue
Block a user