Repository navigation
fix: add missing D-Bus activation files for FileNameIndex and OcrIndex - #297
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideConfigurationAdd activation files for FileNameIndex and OcrIndex and update installation rules so all three D-Bus services are packaged.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/index/CMakeLists.txt" line_range="151-152" />
<code_context>
-install(FILES assets/dbus/org.deepin.Filemanager.TextIndex.service
+install(FILES
+ assets/dbus/org.deepin.Filemanager.TextIndex.service
+ assets/dbus/org.deepin.Filemanager.FileNameIndex.service
+ assets/dbus/org.deepin.Filemanager.OcrIndex.service
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/dbus-1/services)
# The three interface XMLs in assets/dbus/ are the canonical source for
</code_context>
<issue_to_address>
**New D-Bus names cannot activate**
When the project is built and installed through Debian packaging, `dh_install` reads `debian/deepin-anything-index.install`, which lists only the TextIndex activation file, so the FileNameIndex and OcrIndex files are omitted from the package and requests for those names return `ServiceUnknown` after the service stops.
Add both new activation file paths to `debian/deepin-anything-index.install`.
</issue_to_address>
### Comment 2
<location path="src/index/CMakeLists.txt" line_range="151-152" />
<code_context>
-install(FILES assets/dbus/org.deepin.Filemanager.TextIndex.service
+install(FILES
+ assets/dbus/org.deepin.Filemanager.TextIndex.service
+ assets/dbus/org.deepin.Filemanager.FileNameIndex.service
+ assets/dbus/org.deepin.Filemanager.OcrIndex.service
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/dbus-1/services)
# The three interface XMLs in assets/dbus/ are the canonical source for
</code_context>
<issue_to_address>
**Fallback activation cannot start service**
When the D-Bus broker cannot use systemd activation and falls back to `Exec`, both new service files point `Exec` to `/usr/bin/deepin-anything-index`, which the package does not install, so D-Bus activation fails to start the index service.
Install the index executable at `/usr/bin/deepin-anything-index` or change both `Exec` paths to its installed location.
</issue_to_address>| assets/dbus/org.deepin.Filemanager.FileNameIndex.service | ||
| assets/dbus/org.deepin.Filemanager.OcrIndex.service |
There was a problem hiding this comment.
🟡 Medium · Fallback activation cannot start service
When the D-Bus broker cannot use systemd activation and falls back to Exec, both new service files point Exec to /usr/bin/deepin-anything-index, which the package does not install, so D-Bus activation fails to start the index service.
Install the index executable at /usr/bin/deepin-anything-index or change both Exec paths to its installed location.
Prompt for AI agents
In `src/index/CMakeLists.txt` at lines 151-152:
**Fallback activation cannot start service**
When the D-Bus broker cannot use systemd activation and falls back to `Exec`, both new service files point `Exec` to `/usr/bin/deepin-anything-index`, which the package does not install, so D-Bus activation fails to start the index service.
Install the index executable at `/usr/bin/deepin-anything-index` or change both `Exec` paths to its installed location.1. Root cause: deepin-anything-index registers three D-Bus service names (TextIndex, FileNameIndex, OcrIndex) in serviceentry.cpp, but only TextIndex has a .service activation file; the other two cannot be auto-activated by D-Bus when the service is stopped 2. Fix: add org.deepin.Filemanager.FileNameIndex.service and org.deepin.Filemanager.OcrIndex.service under assets/dbus/, both pointing to the same Exec and SystemdService as TextIndex.service; update CMakeLists.txt install rule to deploy all three 3. Impact: file index and OCR index now auto-start the service like full-text index already does; no change to existing TextIndex behavior or any function signatures Log: 文件索引和图片文本内容索引在服务停止后可自动激活索引服务 Influence: 1. Stop deepin-anything-index.service, click "File Index" and verify the service activates and indexing starts 2. Stop the service, click "Image Text Content Index" and verify the service activates and indexing starts 3. Stop the service, click "Full Text Index" and verify no regression 4. Verify three .service files are installed in dbus-1/services/ fix: 补全 FileNameIndex 和 OcrIndex 的 D-Bus 激活文件 1. 根因:deepin-anything-index 进程在 serviceentry.cpp 中注册了三个 D-Bus 服务名(TextIndex、FileNameIndex、OcrIndex),但仅 TextIndex 有 .service 激活文件;服务停止后 D-Bus 收到对另外两个服务名的调用 时找不到激活文件,返回 ServiceUnknown,无法自动启动进程 2. 方案:在 assets/dbus/ 下新增 FileNameIndex.service 和 OcrIndex.service, Exec 和 SystemdService 与 TextIndex.service 一致;CMakeLists.txt 安装规则一并安装三个文件 3. 影响:文件索引和图片文本内容索引在服务停止后可像全文索引一样自动 激活服务;不影响现有 TextIndex 行为,不修改任何函数签名 Log: 文件索引和图片文本内容索引在服务停止后可自动激活索引服务 Influence: 1. 停止 deepin-anything-index.service 后点击"文件索引",验证服务被激活且索引更新成功 2. 停止服务后点击"图片文本内容索引",验证服务被激活且索引更新成功 3. 停止服务后点击"全文索引",验证无回归 4. 验证 dbus-1/services/ 目录下三个 .service 文件均已安装 PMS: BUG-TASK-395529
2021211 to
b3ef4a0
Compare
Root Cause Analysis
deepin-anything-indexregisters three D-Bus service names (TextIndex,FileNameIndex,OcrIndex) inserviceentry.cpp:31-45, but onlyTextIndexhas a.serviceactivation file. When the service is stopped, D-Bus cannot auto-activate the process forFileNameIndexorOcrIndexmethod calls — it returnsServiceUnknown. On the dde-file-manager side,AbstractIndexController::setupDBusConnections()usesstd::call_onceto start the service only once, so after the service stops, subsequent calls toFileNameIndex/OcrIndexfail.Fix
Add
org.deepin.Filemanager.FileNameIndex.serviceandorg.deepin.Filemanager.OcrIndex.serviceunderassets/dbus/, with the sameExecandSystemdServiceasTextIndex.service. UpdateCMakeLists.txtto install all three.servicefiles todbus-1/services/.Change Safety Assessment
Code Safety
.serviceconfig files and extends theinstall(FILES ...)list inCMakeLists.txt. No function signatures changed, no public APIs modified.TextIndex.servicewas introduced by commit8d481bc(service migration).FileNameIndex.serviceandOcrIndex.servicenever existed — this is a migration omission, not a regression of a prior fix.Business Impact Scope
deepin-anything-index.service(viaFileIndexController)OcrIndexController)TextIndex.serviceunchangedVerification Suggestion
Stop
deepin-anything-index.service, then click "File Index", "Image Text Content Index", and "Full Text Index" separately — verify all three activate the service and start indexing. Verify three.servicefiles are installed indbus-1/services/.根因分析
deepin-anything-index进程在serviceentry.cpp:31-45注册了三个 D-Bus 服务名(TextIndex、FileNameIndex、OcrIndex),但仅有TextIndex存在.service激活文件。服务停止后,D-Bus 收到对FileNameIndex/OcrIndex的方法调用时找不到激活文件,返回ServiceUnknown。dde-file-manager 侧AbstractIndexController::setupDBusConnections()通过std::call_once仅执行一次startService,服务停止后不会再次触发激活。修复方案
在
assets/dbus/下新增FileNameIndex.service和OcrIndex.service,Exec和SystemdService与TextIndex.service一致;更新CMakeLists.txt安装规则一并安装三个文件。改动安全评估
代码安全评估
.service配置文件,扩展CMakeLists.txt的install(FILES ...)列表,不修改任何函数签名或公开接口。TextIndex.service由 commit8d481bc(服务迁移)引入,FileNameIndex.service和OcrIndex.service从未存在——迁移遗漏,非历史修复回退。业务影响范围
FileIndexController)OcrIndexController)TextIndex.service未修改)验证建议
停止
deepin-anything-index.service后分别点击"文件索引"、"图片文本内容索引"、"全文索引",验证三者均可激活服务并开始索引更新。验证dbus-1/services/目录下三个.service文件均已安装。Summary by Sourcery
Enable D-Bus auto-activation for all deepin-anything index services so file, OCR, and text indexing continue to work after the service stops.
New Features:
Bug Fixes:
Build: