Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled null check operator exception when user is removed from a channel #1753

Closed
1 task done
jmain20 opened this issue Oct 18, 2023 · 4 comments · Fixed by #1785
Closed
1 task done

Unhandled null check operator exception when user is removed from a channel #1753

jmain20 opened this issue Oct 18, 2023 · 4 comments · Fixed by #1785
Labels
bug Something isn't working

Comments

@jmain20
Copy link

jmain20 commented Oct 18, 2023

Which packages are you using?

stream_chat, stream_chat_flutter, stream_chat_flutter_core, stream_chat_persistance, stream_chat_localizations

On what platforms did you experience the issue?

iOS, Android

What version are you using?

stream_chat: 6.9.0
stream_chat_flutter: 6.11.0
stream_chat_flutter_core: 6.10.0
stream_chat_localizations: 5.11.0
stream_chat_persistence: 6.9.0

What happened?

I got an error from the Stream client when the current user was removed from a channel. If the user was viewing a list of the channel members when they were removed from the channel, the error prevents the list of channel members in the view from updating correctly.

The user has permission to view channel members without being a member of the channel, so I would expect the view to update and show the correct list of channel members (not including the current user that was just removed).

Steps to reproduce

1. Connect to chat from the Flutter client app
2. Open a view that shows the members of a channel
3. Remove that user from the channel

Supporting info to reproduce

No response

Relevant log output

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      ClientState._listenChannelLeft.<anonymous closure>
client.dart:1662
#1      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#2      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#3      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#4      _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#5      _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)
#6      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#8      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#9      _MultiStreamController.addSync (dart:async/stream_impl.dart:1044:36)
#10     _MultiControllerSink.add
forwarding_stream.dart:130
#11     _StartWithStreamSink.on<…>

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jmain20 jmain20 added the bug Something isn't working label Oct 18, 2023
@esarbanis
Copy link
Contributor

Hi @jmain20 !

Thank you for opening this issue! Can you please share the full log?

@jmain20
Copy link
Author

jmain20 commented Oct 31, 2023

@esarbanis Sure, hopefully this provides some more context:

[+5460 ms] flutter: 2023-10-31 10:44:20.123156 ℹ️ 🔌 Event received: notification.mark_read
[ +6 ms] flutter: 2023-10-31 10:44:20.130140 ℹ️ 🔌 Event received: notification.removed_from_channel
[ +38 ms] flutter: 2023-10-31 10:44:20.169188 ℹ️ 🔌 Event received: member.removed
[ +5 ms] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0 ClientState._listenChannelLeft.
client.dart:1662
#1 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#2 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#3 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#4 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#5 _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)
#6 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#7 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#8 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#9 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#10 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#11 _DelayedData.perform (dart:async/stream_i<…>
[log] NewRelic: log error: Null check operator used on a null value --- message: null --- stackTrace: #0 ClientState._listenChannelLeft.
client.dart:1662
#1 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#2 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#3 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#4 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#5 _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)
#6 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#7 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#8 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#9 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#10 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#11 _DelayedData.perform (dart:async/stream_impl.dart:515:14)
#12 _PendingEvents.handleNext (dart:async/stream_impl.dart:620:11)
#13 _PendingEvents.schedule. (dart:async/stream_impl.dart:591:7)
#14 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#15 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
[ +34 ms] flutter: 2023-10-31 10:44:20.207882 ℹ️ 🔌 Event received: channel.updated
[ +5 ms] flutter: 2023-10-31 10:44:20.213066 ℹ️ 📡 Query channel start
[ ] flutter: 2023-10-31 10:44:20.213980 ℹ️ 📡 Query channel start
[ +1 ms] flutter: 2023-10-31 10:44:20.214941 ℹ️ 📡 Query channel start
[ ] flutter: 2023-10-31 10:44:20.215804 ℹ️ 📡 Query channel start
[ +2 ms] flutter: 2023-10-31 10:44:20.219145 ℹ️ 🔌 Event received: notification.mark_read
[ +5 ms] flutter: 2023-10-31 10:44:20.225309 ℹ️ 🔌 Event received: message.read
[ +17 ms] flutter: 2023-10-31 10:44:20.242977 ℹ️ 🔌 Event received: message.new
[ +5 ms] flutter: 2023-10-31 10:44:20.247847 ℹ️ 📡 Query channel start
[ +1 ms] flutter: 2023-10-31 10:44:20.248714 ℹ️ 📡 Query channel start
[ +1 ms] flutter: 2023-10-31 10:44:20.249518 ℹ️ 📡 Query channel start
[ ] flutter: 2023-10-31 10:44:20.250642 ℹ️ 📡 Query channel start
[ +73 ms] flutter: 2023-10-31 10:44:20.324490 ℹ️ 📡 Query channel start
[ +161 ms] flutter: 2023-10-31 10:44:20.486135 ℹ️ 📡 Got 0 channels from api
[ +2 ms] flutter: 2023-10-31 10:44:20.488271 ℹ️ 📡 Got 0 channels from api
[ +2 ms] flutter: 2023-10-31 10:44:20.491028 ℹ️ 📡 Got 0 channels from api
[ +8 ms] flutter: 2023-10-31 10:44:20.499897 ℹ️ 📡 Got 1 channels from api
[ ] flutter: 2023-10-31 10:44:20.500669 ℹ️ 📡 New Channel instance initialized
[+1702 ms] flutter: 2023-10-31 10:44:20.597694 ℹ️ 📡 Got 1 channels from api
[ ] flutter: 2023-10-31 10:44:20.634573 ℹ️ 📡 Query channel start
[ +123 ms] flutter: 2023-10-31 10:44:22.231602 ℹ️ 📡 Got 3 channels from api
[+6025 ms] flutter: 2023-10-31 10:44:24.625191 ℹ️ 🔌 Sending Event: health.check
[ ] flutter: 2023-10-31 10:44:24.661189 ℹ️ 🔌 Needs to reconnect : false
[ ] flutter: 2023-10-31 10:44:24.692275 ℹ️ 🔌 Event received: health.check
[ ] flutter: 2023-10-31 10:44:24.692687 ℹ️ 🔌 HealthCheck received : 648ae73d-0a1d-3ab8-0000-00000726bfa4

@jmain20
Copy link
Author

jmain20 commented Nov 10, 2023

Hi @esarbanis, any updates on this?

@esarbanis
Copy link
Contributor

Hi @jmain20 I will be checking it out the following days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants