WeKnora/internal
MidoriKurage 236d8c098f
fix(datasource): perform real sync deletions scoped per data source (#2690)
* test(datasource): cover scoped sync deletions

- deleted connector items remove the matching KB knowledge, scoped per data
  source via metadata datasource_id + external_id
- SyncDeletions=false neither deletes nor counts
- stream handler classifies deleted/failed items like the batch loop

* fix(datasource): perform real sync deletions scoped per data source

- applyFetchedItem now performs the KB deletion instead of only counting
- lookup is scoped to datasource_id + external_id so identical external IDs
  from two data sources cannot collide or overwrite each other
- ingestItem update-path lookup uses the same scoped query

* fix(datasource): note failed deletions retry only on full sync

- SyncResult.DeletionFailed tracks deletion failures (subset of Failed)
- streaming partial message warns that failed deletions only retry on a full
  sync, since the connector cursor is checkpointed past the deleted item

* fix(datasource): humanize deletion errors, keep raw detail in logs

- raw lookup/delete errors go to server logs only, with full context
- UI samples carry a humanized "see server logs" fallback
- add datasource.syncError.* i18n keys

Note: ko-KR / ru-RU syncError translations were generated without a
native-speaker review.

* fix(datasource): hard-delete synced rows and tighten deletion scoping

Sync-internal deletions now call HardDeleteKnowledge after the soft-delete
cascade so tombstones cannot block re-sync; subtree sweeps and URL metadata
attach failures are handled with datasource scoping and explicit errors.

* chore: add git hooks aligned with CI and PR checks

Install via scripts/install-git-hooks.sh (sets core.hooksPath). Pre-commit
runs whitespace/gofmt/golangci-lint on staged files; pre-push mirrors
app/frontend/cli workflows on the diff since origin/main.

* fix: gofmt test file; tighten pre-push to match CI app workflow

Pre-push now gofmts the full PR diff and runs go vet on all app packages
(like app.yml), not only Go files in the latest commit. Previous pushes
skipped checks via --no-verify and because hook-only commits had no .go files.

* fix(hooks): align pre-push diff with GitHub PR base via gh

Use three-dot diff against the open PR baseRefOid (same as CI) instead of
a two-dot merge-base range; run full go vet on every push with Go PR changes.

* style: gofumpt datasource_service_test.go

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-13 19:52:44 +08:00
..
agent feat(memory): introduce long-term memory feature with i18n updates 2026-08-13 18:00:02 +08:00
application fix(datasource): perform real sync deletions scoped per data source (#2690) 2026-08-13 19:52:44 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
config fix(config): 补齐 WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS 的 env 读取 2026-08-10 19:40:09 +08:00
container feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
database fix(knowledge): address auto-tag review findings 2026-08-07 15:01:01 +08:00
datasource feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
errors refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
event feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
handler 修复:同步 knowledge-search 的 Swagger 路由 2026-08-13 18:08:58 +08:00
im feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
infrastructure style(docparser): gofmt mineru converter tests 2026-08-13 18:51:27 +08:00
logger refactor(context): replace middleware.EmbedChannelContextKey with types.EmbedChannelContextKey 2026-08-13 18:00:02 +08:00
mcp fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
middleware refactor(context): replace middleware.EmbedChannelContextKey with types.EmbedChannelContextKey 2026-08-13 18:00:02 +08:00
modelcontext feat(memory): introduce long-term memory feature with i18n updates 2026-08-13 18:00:02 +08:00
models feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
runtime fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
sandbox feat(sandbox): enhance logging for sandbox operations and error diagnostics 2026-08-12 10:53:46 +08:00
searchutil fix(chunks): trim trusted overlaps by exact position, not text search 2026-08-06 12:26:15 +08:00
storageallowlist fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storageurl fix(api): address resource_urls review follow-ups 2026-08-05 14:42:51 +08:00
stream feat(redis): support TLS for Redis connections (#1930) 2026-07-06 23:02:02 +08:00
tracing/langfuse feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
types fix(datasource): perform real sync deletions scoped per data source (#2690) 2026-08-13 19:52:44 +08:00
utils feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00