Skip to content

fix: remove appId parameter from token request#1626

Merged
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:xdgactivation
Jun 9, 2026
Merged

fix: remove appId parameter from token request#1626
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:xdgactivation

Conversation

@18202781743

Copy link
Copy Markdown
Contributor

The token request no longer requires the appId from tray-loader when
requesting an activation token from the outer compositor. This change
was made to simplify the token retrieval process, as the appId parameter
is not needed by the outer compositor for token generation in this
context.

Log: Removed unnecessary appId parameter from token request

Influence:

  1. Test activation token generation and validation
  2. Verify token request works without appId parameter
  3. Ensure existing functionality remains intact

fix: 移除令牌请求中的 appId 参数

当从外部合成器请求激活令牌时,不再需要 tray-loader 传递的 appId。此更
改简化了令牌获取流程,因为在此上下文中,外部合成器生成令牌不需要 appId
参数。

Log: 移除令牌请求中不必要的 appId 参数

Influence:

  1. 测试激活令牌的生成和验证功能
  2. 验证没有 appId 参数时令牌请求是否正常
  3. 确保现有功能不受影响

The token request no longer requires the appId from tray-loader when
requesting an activation token from the outer compositor. This change
was made to simplify the token retrieval process, as the appId parameter
is not needed by the outer compositor for token generation in this
context.

Log: Removed unnecessary appId parameter from token request

Influence:
1. Test activation token generation and validation
2. Verify token request works without appId parameter
3. Ensure existing functionality remains intact

fix: 移除令牌请求中的 appId 参数

当从外部合成器请求激活令牌时,不再需要 tray-loader 传递的 appId。此更
改简化了令牌获取流程,因为在此上下文中,外部合成器生成令牌不需要 appId
参数。

Log: 移除令牌请求中不必要的 appId 参数

Influence:
1. 测试激活令牌的生成和验证功能
2. 验证没有 appId 参数时令牌请求是否正常
3. 确保现有功能不受影响

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

这段代码的修改看起来是将 m_appId 参数替换为空对象 {}。这是一个潜在的严重问题,我来分析一下:

  1. 语法逻辑:

    • 修改后,requestOuterToken 函数接收一个空对象 {} 作为参数,而不是原来的 m_appId
    • 这可能导致函数内部无法正确获取应用程序标识符,从而影响激活令牌的生成和使用。
  2. 代码质量:

    • 这是一次破坏性的修改,移除了有意义的参数,降低了代码的可读性和可维护性。
    • 没有提供任何注释说明为什么要进行这个修改。
  3. 代码性能:

    • 性能影响不大,但可能导致不必要的错误处理或重试逻辑。
  4. 代码安全:

    • 这是一个安全隐患,因为应用程序标识符对于正确处理激活令牌至关重要。
    • 使用空对象可能导致令牌验证失败或被拒绝。

建议改进:

void XdgActivationTokenV1::xdg_activation_token_v1_commit(Resource *resource)
{
    // Store this token as pending and request from the outer compositor
    m_manager->setPendingToken(this);
    m_manager->requestOuterToken(m_appId);  // 恢复原来的参数
}

如果确实需要修改这个函数调用,应该:

  1. 明确说明修改原因
  2. 确保 requestOuterToken 函数能够正确处理空参数的情况
  3. 添加适当的错误处理逻辑

例如,如果修改是必要的,可以这样改进:

void XdgActivationTokenV1::xdg_activation_token_v1_commit(Resource *resource)
{
    // Store this token as pending and request from the outer compositor
    m_manager->setPendingToken(this);
    
    // 如果没有有效的appId,使用空字符串而不是空对象
    if (m_appId.isEmpty()) {
        qWarning() << "Attempting to request activation token with empty appId";
        m_manager->requestOuterToken("");
    } else {
        m_manager->requestOuterToken(m_appId);
    }
}

这样的修改更加安全,并且提供了更好的错误处理和日志记录。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@18202781743 18202781743 merged commit db53374 into linuxdeepin:master Jun 9, 2026
10 of 12 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