Skip to content

Conversation

@yixinshark
Copy link
Contributor

as title

Log: as title

@yixinshark yixinshark force-pushed the fix-emptyNotification branch 2 times, most recently from 132b0a1 to 5bf0fc8 Compare December 5, 2024 05:57

if (entity.processedType() != NotifyEntity::None) {
qint64 id = m_persistence->addEntity(entity);
if (id == -1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

addEntity错误返回的是0,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addEntity错误返回的是0,

以将错误返回改为-1

@yixinshark yixinshark force-pushed the fix-emptyNotification branch 5 times, most recently from 856e459 to 5d34ef7 Compare December 6, 2024 02:10
as title

Log: as title
@yixinshark yixinshark force-pushed the fix-emptyNotification branch from 5d34ef7 to 99c29be Compare December 6, 2024 02:27
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • DBAccessor类中,isDatabaseCorrupted函数使用了this指针,但在lambda表达式中直接使用this可能会导致编译错误,因为lambda表达式默认是const的。应该使用[=][&]来捕获this指针。
  • DBAccessor类中,当数据库可能损坏时,创建了一个新的数据库文件,但没有检查新数据库是否成功创建。应该添加检查以确保新数据库创建成功。
  • DBAccessor类中,当数据库损坏时,直接关闭了连接并尝试打开新数据库,但没有处理可能出现的异常情况。应该添加异常处理逻辑。
  • DBAccessor类中,当数据库损坏时,没有清理旧的数据库文件。应该添加逻辑来删除旧的数据库文件。
  • DBAccessor类中,tryToCreateTable函数被调用,但没有检查它是否成功。应该添加检查以确保表创建成功。
  • DBAccessor类中,addEntity函数返回-1表示插入失败,但没有定义返回-1的具体含义。应该定义一个常量或枚举来表示错误代码。
  • DBusAdaptorDDENotificationDbusAdaptor类中,当Notify函数返回std::numeric_limits<uint>::max()时,应该抛出一个异常或返回一个错误码,而不是发送一个DBus错误消息。这可能会导致调用者无法正确处理错误。
  • DBusAdaptorDDENotificationDbusAdaptor类中,Notify函数的返回值类型是uint,但在返回std::numeric_limits<uint>::max()时,应该返回一个更具体的错误码,而不是uint的最大值。

是否建议立即修改:

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, yixinshark

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yixinshark
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Dec 6, 2024

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 242a1dc into linuxdeepin:master Dec 6, 2024
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants