Skip to content

fix: stop deployment log polling after cancellation#201

Open
tejas-contentstack wants to merge 1 commit into
developmentfrom
cl-4065-cancel-deployment-log-polling
Open

fix: stop deployment log polling after cancellation#201
tejas-contentstack wants to merge 1 commit into
developmentfrom
cl-4065-cancel-deployment-log-polling

Conversation

@tejas-contentstack

@tejas-contentstack tejas-contentstack commented Jul 22, 2026

Copy link
Copy Markdown

What

deploymentStatus terminal-state list (src/config/index.ts) was missing CANCELLED, so LogPolling (src/util/logs-polling-utilities.ts) never matched a cancelled deployment as terminal and kept polling both the deployment-status and deployment-logs queries indefinitely after csdx launch:logs on a cancelled deployment.

Fix: add CANCELLED to the terminal deploymentStatus array.

Tests

  • Added regression tests in src/util/logs-polling-utilities.test.ts:
    • status polling stops once deployment status is CANCELLED
    • deployment-logs polling stops and emits DONE once status is CANCELLED
    • guard test proving the old array (without CANCELLED) reproduces the bug (stopPolling never called)
    • assertion that the real src/config default now includes CANCELLED
  • Full suite: npm test — 127/127 passing
  • tsc --noEmit clean

@tejas-contentstack
tejas-contentstack requested review from a team as code owners July 22, 2026 07:18
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 4 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

deploymentStatus terminal-state list was missing CANCELLED, so
csdx launch:logs kept polling the deployment-status and
deployment-logs queries indefinitely after a deployment was
cancelled.

Co-Authored-By: Rohan Agrawal <rohan.agrawal@contentstack.com>
@tejas-contentstack
tejas-contentstack force-pushed the cl-4065-cancel-deployment-log-polling branch from da6facd to 749a24a Compare July 22, 2026 07:21
@tejas-contentstack tejas-contentstack changed the title CL-4065 | +Claude | Stop deployment log polling once deployment is cancelled fix: stop deployment log polling after cancellation Jul 22, 2026
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 4 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

Comment thread src/config/index.ts
launchBaseUrl: '',
supportedAdapters: ['GitHub'],
deploymentStatus: ['LIVE', 'FAILED', 'SKIPPED', 'DEPLOYED'],
deploymentStatus: ['LIVE', 'FAILED', 'SKIPPED', 'DEPLOYED', 'CANCELLED'],

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.

we do not see deployment status on the terminal right ?
what was this use case about to add cancel as well

expect(statusWatchQuery.stopPolling).toHaveBeenCalledTimes(1);
});

it('stops deployment-logs polling and emits DONE once status is CANCELLED', async () => {

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.

is this tested locally ?

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.

3 participants