-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
If an exception is thrown by ref.opExecuted, other subscribers are not notified of a change
Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/observability/ChangeManager.kt
Lines 73 to 86 in 34878f0
| 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
notifySubscriberscare, or be fully decoupled from the subscribers
- Should the caller of
Related: