Skip to content

Commit 8baf4b5

Browse files
committed
api: Allow SubscriptionUpdateEvent with unrecognized property
Our event poll shouldn't crash on subscription/update events about data that we don't store and act on. This bugfix allows servers to add new Subscription fields and send corresponding events without causing the app to discard its data and reregister a new event queue. Soon, for #1837, we'd like to remove SubscriptionProperty.inHomeView, which was deprecated in FL 139. Events with in_home_view are still sent by modern servers (as of CZO 2025-10-03), but we never need them because they always come with an is_muted event. Now, when we remove SubscriptionProperty.inHomeView, the in_home_view event will parse instead of not parsing, and it'll have SubscriptionProperty.unknown for `property`, which the store already ignores.
1 parent f9ff2cf commit 8baf4b5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/api/model/events.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ class SubscriptionUpdateEvent extends SubscriptionEvent {
762762

763763
final int streamId;
764764

765+
@JsonKey(unknownEnumValue: SubscriptionProperty.unknown)
765766
final SubscriptionProperty property;
766767

767768
/// The new value, or null if we don't recognize the setting.

lib/api/model/events.g.dart

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)