@@ -4,7 +4,7 @@ use crate::{
44 authentication:: Credentials ,
55 dealer:: {
66 manager:: { BoxedStream , BoxedStreamResult , Reply , RequestReply } ,
7- protocol:: { Command , Message , Request } ,
7+ protocol:: { Command , FallbackWrapper , Message , Request } ,
88 } ,
99 session:: UserAttributes ,
1010 Error , Session , SpotifyId ,
@@ -81,7 +81,7 @@ struct SpircTask {
8181 connect_state_volume_update : BoxedStreamResult < SetVolumeCommand > ,
8282 connect_state_logout_request : BoxedStreamResult < LogoutCommand > ,
8383 playlist_update : BoxedStreamResult < PlaylistModificationInfo > ,
84- session_update : BoxedStreamResult < SessionUpdate > ,
84+ session_update : BoxedStreamResult < FallbackWrapper < SessionUpdate > > ,
8585 connect_state_command : BoxedStream < RequestReply > ,
8686 user_attributes_update : BoxedStreamResult < UserAttributesUpdate > ,
8787 user_attributes_mutation : BoxedStreamResult < UserAttributesMutation > ,
@@ -191,7 +191,7 @@ impl Spirc {
191191
192192 let session_update = session
193193 . dealer ( )
194- . listen_for ( "social-connect/v2/session_update" , Message :: from_json ) ?;
194+ . listen_for ( "social-connect/v2/session_update" , Message :: try_from_json ) ?;
195195
196196 let user_attributes_update = session
197197 . dealer ( )
@@ -1552,7 +1552,24 @@ impl SpircTask {
15521552 Ok ( ( ) )
15531553 }
15541554
1555- fn handle_session_update ( & mut self , mut session_update : SessionUpdate ) {
1555+ fn handle_session_update ( & mut self , session_update : FallbackWrapper < SessionUpdate > ) {
1556+ // we know that this enum value isn't present in our current proto definitions, by that
1557+ // the json parsing fails because the enum isn't known as proto representation
1558+ const WBC : & str = "WIFI_BROADCAST_CHANGED" ;
1559+
1560+ let mut session_update = match session_update {
1561+ FallbackWrapper :: Inner ( update) => update,
1562+ FallbackWrapper :: Fallback ( value) => {
1563+ let fallback_inner = value. to_string ( ) ;
1564+ if fallback_inner. contains ( WBC ) {
1565+ log:: debug!( "Received SessionUpdate::{WBC}" ) ;
1566+ } else {
1567+ log:: warn!( "SessionUpdate couldn't be parse correctly: {value:?}" ) ;
1568+ }
1569+ return ;
1570+ }
1571+ } ;
1572+
15561573 let reason = session_update. reason . enum_value ( ) ;
15571574
15581575 let mut session = match session_update. session . take ( ) {
0 commit comments