Skip to content

feat: add support for skipped tasks and warnings in task processing#1769

Merged
ricofurtado merged 4 commits into
mainfrom
change-of-task-status-for-bucket-connections-sync-of-duplicate-files
Jun 5, 2026
Merged

feat: add support for skipped tasks and warnings in task processing#1769
ricofurtado merged 4 commits into
mainfrom
change-of-task-status-for-bucket-connections-sync-of-duplicate-files

Conversation

@ricofurtado

@ricofurtado ricofurtado commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces a new "skipped" status for task files to represent files that are intentionally not processed (such as due to duplicate filenames), and updates both backend and frontend logic to support this status. The UI now distinguishes between failed and warning (skipped) files, providing clearer feedback to users. Tests and utility functions are updated to reflect these changes.

Backend logic changes:

  • Added a "skipped" status for task files (instead of marking as "failed") when a file is not processed due to a duplicate filename; this status includes a warning message in result, and increments successful_files instead of failed_files in these cases.
  • Updated unit tests to expect the new "skipped" status and warning message, ensuring correct handling and accounting for skipped files. [1] [2] [3] [4]

Frontend and UI changes:

  • Added support for the "skipped" status in the TaskFileEntry and Task types, and introduced a new "warning" category for task file status. [1] [2] [3]
  • Updated utility functions to recognize and handle "skipped" files as warnings, including new helpers to fetch warning entries and aggregate both failed and warning files as issues. [1] [2] [3] [4] [5]
  • Enhanced the task error UI to display warning counts, label warnings separately from failures, and use distinct styles and icons for warnings (amber color and triangle alert icon). [1] [2] [3] [4] [5] [6] [7]

Error message improvements:

  • Updated error resolution logic to show warning messages from the backend for skipped files, improving user feedback.l

Summary by CodeRabbit

  • New Features

    • Tasks now support a "skipped" status indicator
    • Added a "Warning" status category with distinct visual styling
    • Task dialogs and summaries now display warnings separately from errors
  • Bug Fixes

    • Duplicate files are now marked as skipped/warning instead of failures, allowing uploads to continue
    • File error displays and notifications now surface warnings when present

@github-actions github-actions Bot added frontend 🟨 Issues related to the UI/UX backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) tests labels Jun 5, 2026
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1063898-469a-4dda-9938-4766d0a8704e

📥 Commits

Reviewing files that changed from the base of the PR and between 59b7e5b and 180fe66.

📒 Files selected for processing (1)
  • frontend/lib/task-utils.ts

Walkthrough

Adds "skipped" status for duplicate uploads; backend marks duplicates as SKIPPED when replace_duplicates=false; frontend types, utilities, and components treat skipped files as warnings and render warning UI; tests updated to expect skipped/warning behavior.

Changes

Skipped file status and warning display

Layer / File(s) Summary
Type system and utility functions
frontend/app/api/queries/useGetTasksQuery.ts, frontend/lib/task-utils.ts
Extend TaskFileEntry.status and Task.status to include "skipped". Add TaskFileStatusCategory "warning". Add isTaskFileWarning(). Update getTaskFileDialogStatusLabel() and getTaskFileStatusCategory() for "Warning"/"warning". Add getWarningFileEntries(), getTaskIssueFileEntries(), and hasIssueFileEntries(); include warning bucket in counters.
UI constants and component integration
frontend/components/task-dialog/constants.ts, frontend/lib/task-error-display.ts, frontend/components/task-error-content.tsx
Import TriangleAlert and add a "warning" chip with amber styling. resolveTaskFileError() now prefers fileInfo.result.warning when present. TaskErrorContent computes issueEntries (failed OR warning), derives warningCount, updates status label/pill logic, adjusts early-return, shows warning count in accordion summary, and applies warning-specific styling in the file list.
Notification menu integration
frontend/components/task-notification-menu.tsx
Switch imports and logic to use hasIssueFileEntries() so skipped/warning files affect active and past task displays and expansion logic.
Backend duplicate file handling
src/models/processors.py
ConnectorFileProcessor.process_item() marks duplicate filenames as SKIPPED with a structured result (duplicate_filename) and clears file error when replace_duplicates=False, incrementing upload_task.successful_files. When replace_duplicates=True, it deletes existing documents using delete_document_by_filename(..., owner_user_id=self.user_id).
Unit tests for duplicate handling
tests/unit/test_connector_processor_filename_dedupe.py
Updated tests to expect TaskStatus.SKIPPED, error is None, a structured result including warning, and upload_task.successful_files==1 / failed_files==0 for duplicate filename scenarios in connector and Langflow processors.

Sequence Diagram(s)

sequenceDiagram
  participant Connector as ConnectorFileProcessor
  participant OpenSearch as OpenSearchClient
  participant Upload as UploadTask
  Connector->>OpenSearch: check filename exists
  alt filename exists and replace_duplicates=false
    Connector-->>Upload: mark FileTask SKIPPED, clear error, result={status: "skipped", reason: "duplicate_filename", warning}
    Connector->>Upload: increment successful_files
  else filename exists and replace_duplicates=true
    Connector->>OpenSearch: delete_document_by_filename(owner_user_id)
    Connector->>Upload: proceed with replacement flow
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • lucaseduoli
  • mfortman11
  • Wallgau
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and specifically describes the main change: introducing support for skipped tasks and warnings in task processing across both backend and frontend.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch change-of-task-status-for-bucket-connections-sync-of-duplicate-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jun 5, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/lib/task-utils.ts`:
- Around line 252-257: The function hasFailedFileEntries now returns true for
both failed and warning file entries (it calls getTaskIssueFileEntries), which
mismatches its name and causes callers like isCompletedWithFailures to
misclassify warnings as failures; either rename hasFailedFileEntries to reflect
the broader check (e.g., hasIssueFileEntries) and update all callers (including
isCompletedWithFailures) to the new name, or restore strict failure semantics by
changing hasFailedFileEntries to only check task.failed_files and add a new
helper (e.g., hasWarningOrIssueFileEntries) that uses getTaskIssueFileEntries
for warning-aware checks, then update callers accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8a6d4d1b-6bb0-48c2-ac80-bfec5655eabb

📥 Commits

Reviewing files that changed from the base of the PR and between f6eaf76 and bf2072b.

📒 Files selected for processing (7)
  • frontend/app/api/queries/useGetTasksQuery.ts
  • frontend/components/task-dialog/constants.ts
  • frontend/components/task-error-content.tsx
  • frontend/lib/task-error-display.ts
  • frontend/lib/task-utils.ts
  • src/models/processors.py
  • tests/unit/test_connector_processor_filename_dedupe.py

Comment thread frontend/lib/task-utils.ts
@ricofurtado ricofurtado requested review from Wallgau and Copilot June 5, 2026 08:11
@ricofurtado ricofurtado requested review from lucaseduoli and removed request for Copilot June 5, 2026 08:11

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Really good work, just some minor things

Comment thread frontend/components/task-error-content.tsx
Comment thread frontend/lib/task-utils.ts

@Wallgau Wallgau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @ricofurtado, is this something we need for GA? If not, maybe we could postpone it until after GA, just to be on the safe side and avoid introducing additional complexity or potential bugs this late in the cycle.

@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jun 5, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/lib/task-utils.ts`:
- Around line 259-261: hasIssueFileEntries currently just checks
getTaskIssueFileEntries(task).length > 0 and ignores task.failed_files; update
the function hasIssueFileEntries to also return true when task.failed_files (or
task.failedFiles if that naming is used elsewhere) is a positive number so tasks
with missing/partial task.files still report issues; locate hasIssueFileEntries
and getTaskIssueFileEntries in frontend/lib/task-utils.ts and add the fallback
check (e.g., return getTaskIssueFileEntries(task).length > 0 ||
(task.failed_files && task.failed_files > 0)) to preserve the original behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: daea4582-a330-449c-9e1c-50996eaa07bb

📥 Commits

Reviewing files that changed from the base of the PR and between bf2072b and 59b7e5b.

📒 Files selected for processing (3)
  • frontend/components/task-error-content.tsx
  • frontend/components/task-notification-menu.tsx
  • frontend/lib/task-utils.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/components/task-error-content.tsx

Comment thread frontend/lib/task-utils.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jun 5, 2026

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! but we should consider Olfa's comment

@github-actions github-actions Bot added the lgtm label Jun 5, 2026
@ricofurtado ricofurtado merged commit 51d4239 into main Jun 5, 2026
29 of 36 checks passed
@github-actions github-actions Bot deleted the change-of-task-status-for-bucket-connections-sync-of-duplicate-files branch June 5, 2026 15:40
@ricofurtado

Copy link
Copy Markdown
Collaborator Author

merged

@ricofurtado

Copy link
Copy Markdown
Collaborator Author

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) enhancement 🔵 New feature or request frontend 🟨 Issues related to the UI/UX lgtm tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants