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:
or
However, the background script emits:
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
- Configure multiple publishing platforms (for example, Dev.to and LinkedIn).
- Make one platform succeed and another fail (for example, revoke LinkedIn credentials while keeping Dev.to configured correctly).
- Trigger blog generation from a solved LeetCode problem.
- Allow the backend to return a
partial_success response.
- Observe that the extension reports a warning state.
- 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.
Description
Summary
The browser extension can become permanently locked after receiving a
partial_successresponse from the backend.When publishing succeeds on some platforms but fails on others, the background script converts the backend status from
partial_successtowarningand sends aSTATUS_UPDATEmessage. However, the content script only clears its processing lock forsuccessanderrorstatuses.As a result, the internal
isProcessingflag remainstrue, preventing all future blog-generation attempts until the page is manually refreshed.Location
extension/content.js
extension/background.js
(Occurs in multiple message dispatch paths.)
Root Cause
The extension uses an
isProcessingflag as a mutex to prevent duplicate blog-generation requests.The flag is set when generation starts:
and is only cleared when a status update contains:
successor
errorHowever, the background script emits:
warningFor backend
partial_successresponses.Since
warningis not treated as a terminal state by the content script, the processing lock is never released.Steps to Reproduce
partial_successresponse.Expected Behaviour
After any terminal result (
success,error, orpartial_success), the extension should release the processing lock and allow future blog-generation requests.Actual Behaviour
The extension receives a
warningstatus update, butisProcessingremainstrue.Subsequent generation attempts are blocked by:
requiring the user to refresh the page to recover.
Impact
Severity
High
Confidence
High
Suggested Fix
Treat
warningas a terminal state and release the processing lock:or otherwise ensure that all completed processing states clear the
isProcessingflag.