feat(asana): support deleted-file sync (#14468)

### What problem does this PR solve?

Partially addresses #14362.

Adds deleted-file sync support for the Asana data source. Asana already
indexes task attachments as documents, but it did not provide the slim
document snapshot required by stale-document reconciliation, and the
sync wrapper never returned a `file_list` for cleanup.

This PR:
- adds `retrieve_all_slim_docs_perm_sync()` to `AsanaConnector`
- builds slim IDs with the same `asana:{task_id}:{attachment_gid}`
format used by indexed documents
- avoids downloading attachment blobs during the snapshot
- aborts the snapshot if Asana API errors occur, preventing partial
snapshots from deleting valid local docs
- captures the incremental poll end time before snapshotting and makes
`poll_source()` respect that boundary
- exposes the deleted-file sync toggle for Asana in the data source UI

Per maintainer request, this PR contains no test-case changes. Manual
verification recording will be provided separately.

Validation:
- `uv run ruff check common/data_source/asana_connector.py
rag/svr/sync_data_source.py`
- `uv run pytest test/unit_test/rag/test_sync_data_source.py -q`
- `./node_modules/.bin/eslint
src/pages/user-setting/data-source/constant/index.tsx`
- `git diff --check`

### Type of change

- [x] New Feature
This commit is contained in:
bitloi
2026-04-30 03:41:36 -03:00
committed by GitHub
parent e992fe39b2
commit 8f75e52bbf
3 changed files with 117 additions and 33 deletions

View File

@@ -108,6 +108,9 @@ export const DataSourceFeatureVisibilityMap: Partial<
[DataSourceKey.SEAFILE]: {
syncDeletedFiles: true,
},
[DataSourceKey.ASANA]: {
syncDeletedFiles: true,
},
};
const isDataSourceFeatureVisible = (