fix(search): use sub-transaction rollback when truncating document text (#31494)

* fix: implement sub-transactions for partial rollbacks in PgSearchEngineIndexer

Signed-off-by: Stanislav Cherkasov <150145013+stanislav-c@users.noreply.github.com>

* fix: address Copilot review feedback

- Wrap sub-transaction creation in try/catch to handle failures
- Await subTx.commit() and subTx.rollback() to prevent race conditions
- Use inline eslint-disable comments instead of file-level disable
- Use mockResolvedValue for async tx.transaction mock

Signed-off-by: Stanislav Cherkasov <150145013+stanislav-c@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: Stanislav Cherkasov <150145013+stanislav-c@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Stanislav Cherkasov
2026-04-14 14:28:45 +02:00
committed by GitHub
parent c6abc52e1f
commit aa08b7f135
3 changed files with 51 additions and 10 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend-module-pg': patch
---
Fix a bug in large document indexing logic by using sub-transaction rollbacks