Skip to content

fix: keep the sessionize probe running when one event is refused - #5445

Merged
mbani01 merged 1 commit into
mainfrom
fix/issue-1156-sessionize-probe-event-refusal
Nov 25, 2026
Merged

mbani01 merged 1 commit into
mainfrom
fix/issue-1156-sessionize-probe-event-refusal

Conversation

@mbani01

@mbani01 mbani01 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Problem

The Sessionize export probe stopped at the first 403 and skipped every later event. In production, Sessionize answered 403 for one event that the organizer account cannot export. A second run confirmed that the session was still valid: the same new session downloaded another event and was then refused for that one event again.

Change

  • The probe builds the fixed-session HTTP client for each event. A refusal for one event no longer blocks the next events.
  • The probe stops only after five provider.auth failures in a row, which is the sign of a session that is really dead. A rate limit still stops the run at once, and two provider.unavailable failures in a row still stop it.
  • The log line for each event now includes the error class of a failure.

Tests

sessionizeExportProbe.test.ts: 50 of 50 pass. The stop-rule cases cover a single refusal, refusals that are not in a row, and five refusals in a row.

Refs linuxfoundation/lfx-cdp-insights-ops#1156

Sessionize answers 403 for an event the organizer account cannot export.
The probe treated that as a dead session and skipped every later event.
It now uses the session per event and stops only after five refusals in a row.

Refs linuxfoundation/lfx-cdp-insights-ops#1156

Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
@mbani01
mbani01 requested review from a team and lfx-one as code owners November 25, 2026 14:33
@mbani01
mbani01 requested review from joanagmaia and a balanced review from Copilot November 25, 2026 14:33
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Operational probe/script behavior only; no changes to production sync auth or shared connector session handling beyond this CLI.

Overview
The Sessionize export probe no longer aborts the whole run when a single event returns a 403. saveExport now builds a fresh createSessionizeFixedSessionHttp(cookie) for each event instead of reusing one client for the loop, so a refusal on one event does not leave the shared client in a permanently rejected state for the rest of the keys.

nextProbeRunState now tracks consecutive failures by error class: provider.rate_limit still stops immediately, provider.unavailable still stops after two in a row, and provider.auth only stops after five consecutive auth failures (isolated refusals between successes are ignored). Per-event probe logs now include errorClass on failures.

Reviewed by Cursor Bugbot for commit 188574e. Bugbot is set up for automated code reviews on this repo. Configure here.

@lfx-one

lfx-one commented Nov 25, 2026 •

Copy link
Copy Markdown

@mbani01 I'm starting review 1 of this pull request now (started 2026-11-25 14:33 UTC using review agent v0.1.34). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by re-review, to start another. For help with the review agent, see https://github.com/linuxfoundation/lfx-review-agent/issues.


Hi Mouad BANI, thanks for the clear write-up and the focused fix.

Summary

This pull request makes the Sessionize export probe build its HTTP client per event, so one refused event no longer blocks later ones. It also changes the stop rule to count consecutive failures per error class. The change is small and matches its description.

Decision

✅ Approved

Details

Overall impression: The stop rule in nextProbeRunState is correct. A rate limit still stops the run at once. provider.unavailable still stops after 2 in a row. provider.auth stops after 5 in a row, and any other outcome resets the count. Creating the client inside saveExport is cheap and gives each event a fresh client. The new tests cover a single refusal, refusals that are not in a row, and five in a row. I found no blocking, minor or nit issues.

Other reviewers and CI checks: Copilot and Cursor Bugbot also found no issues. The required DCO check passed on 188574e.

Documentation reminder: changed provider.auth stop threshold, per-event Sessionize HTTP client. Please check product pages and external docs; the author and maintainers own those updates.

Rule files: read AGENTS.md, .claude/rules/commit-workflow.md, CONTRIBUTING.md; skipped none

Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified in the Sessionize probe failure-handling changes.

No open issues 🎉

What changed in this PR

This PR makes the Sessionize export probe continue past isolated event refusals while retaining stop rules for repeated failures and rate limits.

Changes:

  • Creates a fixed-session HTTP client for each event and includes failure classes in event logs.
  • Stops after five consecutive authentication failures, two consecutive unavailable failures, or one rate-limit failure.
  • Updates stop-rule tests to cover isolated and consecutive authentication failures.
File Description
services/​apps/​connectors_worker/​src/​sessionizeExportProbe.ts Tracks consecutive failures by error class and applies stop thresholds.
services/​apps/​connectors_worker/​src/​sessionizeExportProbe.test.ts Updates test cases for authentication-failure stop rules.
services/​apps/​connectors_worker/​src/​bin/​probe-sessionize-exports.ts Creates clients per event and logs failure classes.

Review effort: Balanced

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect the bounded Sessionize export probe workflow.

The PR appears safe to merge, with a non-blocking gap in regression coverage.

Fix All in Claude CodeFindings

  1. P2 Tests miss the original failure ▶
Fix with agent prompt
### Issue 1
services/apps/connectors_worker/src/bin/probe-sessionize-exports.ts:109
The new tests check only `nextProbeRunState`. They would still pass if the HTTP client were moved back outside the event loop, restoring the bug where one 403 blocks later exports. Add a regression test that returns 403 for one event, then a valid export for the next. Check that the second export is saved using the same cookie without another sign-in.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The probe now creates a fresh HTTP client for each event while reusing one signed-in session.

  • Each Sessionize event gets a fresh client, so one refusal does not block the next.
  • The probe waits for repeated auth and outage failures, but stops on rate limits.

Reviews (1) · Last reviewed commit: "fix: keep the sessionize probe running w..." · Reviewed by Greptile

try {
const file = await downloadSessionizeExport(
http,
createSessionizeFixedSessionHttp(cookie),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tests miss the original failure

The new tests check only nextProbeRunState. They would still pass if the HTTP client were moved back outside the event loop, restoring the bug where one 403 blocks later exports. Add a regression test that returns 403 for one event, then a valid export for the next. Check that the second export is saved using the same cookie without another sign-in.

Prompt To Fix With AI
This is a comment left during a code review.
Path: services/apps/connectors_worker/src/bin/probe-sessionize-exports.ts
Line: 109

Comment:
**Tests miss the original failure**

The new tests check only `nextProbeRunState`. They would still pass if the HTTP client were moved back outside the event loop, restoring the bug where one 403 blocks later exports. Add a regression test that returns 403 for one event, then a valid export for the next. Check that the second export is saved using the same cookie without another sign-in.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Cursor

@lfx-one lfx-one left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The stop rule now counts consecutive failures per error class, which matches the PR description, and I found no blocking or minor issues. The new nextProbeRunState cases cover the single refusal, the non-consecutive refusals and the five refusals in a row.

Documentation

This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:

  • provider.auth stop threshold (now 5 consecutive failures instead of an immediate stop)
  • per-event Sessionize HTTP client in the export probe

@mbani01
mbani01 merged commit dbfc6d9 into main Nov 25, 2026
15 checks passed
@mbani01
mbani01 deleted the fix/issue-1156-sessionize-probe-event-refusal branch November 25, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants