Skip to content

fix: 排查通知中心回调触发已销毁 State 的问题 #996

Description

@RSS1102

背景

示例通知中心曾记录 TNotification.postNotificationCallHandler 触发 setState() called after dispose() 的错误。当前广播中心保存回调并在事件触发时执行,若页面销毁前未解除订阅,可能继续调用已失效的 State。

期望

  • 复现并确认页面销毁后的回调生命周期问题;
  • 明确订阅方的解除订阅要求,或让通知中心提供更安全的生命周期管理方式;
  • 补充回归测试。

相关代码

  • tdesign-component/example/lib/base/notification_center.dart

该问题原先由 TODO/错误记录提示,不能仅删除注释。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions