Skip to content

ChangeManager: handling multiple exceptions in notifySubscribers #19493

@david-allison

Description

@david-allison

If an exception is thrown by ref.opExecuted, other subscribers are not notified of a change

for (subscriber in subscribers) {
val ref =
try {
subscriber.get()
} catch (e: Exception) {
CrashReportService.sendExceptionReport(e, "notifySubscribers", "16217: invalid subscriber")
null
}
if (ref == null) {
expired.add(subscriber)
} else {
ref.opExecuted(changes, handler)
}
}

What to do is open for discussion

This should likely be updated to:

  • notify all subscribers
  • Potentially throw an aggregate/composite exception
    • Should the caller of notifySubscribers care, or be fully decoupled from the subscribers

Related:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions