Skip to content

[BUG]: Browser extension remains permanently locked after partial_success status updates #217

Description

@VarshithReddy2006

Description

Summary

The browser extension can become permanently locked after receiving a partial_success response from the backend.

When publishing succeeds on some platforms but fails on others, the background script converts the backend status from partial_success to warning and sends a STATUS_UPDATE message. However, the content script only clears its processing lock for success and error statuses.

As a result, the internal isProcessing flag remains true, preventing all future blog-generation attempts until the page is manually refreshed.


Location

extension/content.js

} else if (request.type === 'STATUS_UPDATE') {
    if (request.status === 'success' || request.status === 'error') {
        isProcessing = false;
    }
}

extension/background.js

status: data.status === 'partial_success' ? 'warning' : 'success',

(Occurs in multiple message dispatch paths.)


Root Cause

The extension uses an isProcessing flag as a mutex to prevent duplicate blog-generation requests.

The flag is set when generation starts:

if (isProcessing) return;
isProcessing = true;

and is only cleared when a status update contains:

success

or

error

However, the background script emits:

warning

For backend partial_success responses.

Since warning is not treated as a terminal state by the content script, the processing lock is never released.


Steps to Reproduce

  1. Configure multiple publishing platforms (for example, Dev.to and LinkedIn).
  2. Make one platform succeed and another fail (for example, revoke LinkedIn credentials while keeping Dev.to configured correctly).
  3. Trigger blog generation from a solved LeetCode problem.
  4. Allow the backend to return a partial_success response.
  5. Observe that the extension reports a warning state.
  6. Attempt to trigger blog generation again.

Expected Behaviour

After any terminal result (success, error, or partial_success), the extension should release the processing lock and allow future blog-generation requests.


Actual Behaviour

The extension receives a warning status update, but isProcessing remains true.

Subsequent generation attempts are blocked by:

if (isProcessing) return;

requiring the user to refresh the page to recover.


Impact

  • Users cannot generate another blog after a partial publication failure.
  • The extension appears stuck even though processing has completed.
  • Manual page refreshes are required to restore functionality.
  • Automated publishing workflows become unreliable.

Severity

High

Confidence

High

Suggested Fix

Treat warning as a terminal state and release the processing lock:

const terminalStates = ['success', 'error', 'warning'];

if (terminalStates.includes(request.status)) {
    isProcessing = false;
}

or otherwise ensure that all completed processing states clear the isProcessing flag.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions