The operation ID.
True if removed, false if not found.
export function removeFailedOperation(id: string): boolean {
try {
const queue = getFailedOperations();
const initialLength = queue.operations.length;
queue.operations = queue.operations.filter((op) => op.id !== id);
queue.lastUpdated = Date.now();
// Save updated queue
storage.setItem(STORAGE_KEYS.FAILED_OPERATIONS, JSON.stringify(queue));
const removed = queue.operations.length < initialLength;
if (removed) {
console.info(`[Storage] Removed failed operation: ${id}`);
}
return removed;
} catch (error) {
console.error("[Storage] Failed to remove operation:", error);
throw error;
}
}
Removes a failed operation from the queue.