@@ -13,7 +13,7 @@ import 'store.dart';
1313class  PushDeviceManager  extends  PerAccountStoreBase  {
1414  PushDeviceManager ({
1515    required  super .core,
16-     required  Map <int , PushDeviceEntry >?  pushDevices,
16+     required  Map <int , PushDeviceEntry > pushDevices,
1717  }) :  _registrant =  PushTokenRegistrant (core:  core),
1818       _pushDevices =  pushDevices;
1919
@@ -44,19 +44,13 @@ class PushDeviceManager extends PerAccountStoreBase {
4444  /// For docs, search for "push_device" 
4545  /// in <https://zulip.com/api/register-queue>. 
4646  /// 
47-   /// Null if the server was old and did not provide such a map.  
48- // TODO( server-11) make non-nullable when [InitialSnapshot.pushDevices] is  
49-   late   Map < int ,  PushDeviceEntry > ?  pushDevices  = 
50-     _pushDevices  ==   null   ?   null   :  UnmodifiableMapView (_pushDevices);
51-   final  Map <int , PushDeviceEntry >?  _pushDevices;
47+   /// An absent map in  [InitialSnapshot]  (from an old server) is treated  
48+   /// as empty, since a  server without this feature has none of these records.  
49+ // TODO(server-11) simplify doc re an absent map 
50+   late   Map < int ,  PushDeviceEntry > pushDevices  =  UnmodifiableMapView (_pushDevices);
51+   final  Map <int , PushDeviceEntry > _pushDevices;
5252
5353  void  handlePushDeviceEvent (PushDeviceEvent  event) {
54-     if  (_pushDevices ==  null ) {
55-       // TODO(log)... but in principle this is possible if the server was 
56-       //   upgraded, gaining support for this feature, 
57-       //   in the life of the event queue. 
58-       return ;
59-     }
6054    final  pushAccountId =  int .tryParse (event.pushAccountId, radix:  10 );
6155    if  (pushAccountId ==  null ) return ; // TODO(log); TODO(#1764) push this to API parser 
6256    _pushDevices[pushAccountId] =  event.data;
0 commit comments