Exception join channel

Hi
my developer use flutter sdk, we have exception when getting channel list or join a channel
await AmityChannelRepository().joinChannel(channel.channelPublicId!);

not on all channel but only for some channel, we don’t know why, the channel are creating from backend software all at the same mode. So the channles tructure should be all the same.
This is the exception
flutter: NoSuchMethodError: The method ‘map’ was called on null.
flutter: Receiver: null
flutter: Tried calling: map(Closure: (dynamic) => dynamic)
flutter:
flutter: ---------------
flutter:
flutter: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
flutter: #1 new ChannelResponse.fromJson (package:amity_sdk/src/data/response/core_response/channel_response.dart:108:46)
flutter: #2 new CreateChannelResponse.fromJson. (package:amity_sdk/src/data/response/create_channel_response.dart:45:57)
flutter: #3 MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
flutter: #4 ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
flutter: #5 new List.from (dart:core-patch/array_patch.dart:37:17)
flutter: #6 new CreateChannelResponse.fromJson (package:amity_sdk/src/data/response/create_channel_response.dart:44:19)
flutter: #7 ChannelMemberApiInterfaceImpl.joinChannel (package:amity_sdk/src/data/data_source/remote/http_api_interface_impl/channel_member_api_interface_impl.dart:78:36)
flutter:
flutter: #8 ChannelMemberRepoImpl.joinChannel (package:amity_sdk/src/data/repo_impl/channel_member_repo_impl.dart:54:18)
flutter:
flutter: #9 ChannelWidget.build. (package:tw_o_platform/widgets/atoms/channel_widget.dart:21:11)
flutter:
flutter:

Does this exception cause the crash as well? May I know your current flutter sdk version, please?

SDK version is 0.27.0

Thanks! Could you clarify which types of channels are experiencing this exception? Are they the same type as those that don’t encounter this exception? Also, does this exception lead to crashes?

Yes, all are the same (standard type), attached json use backend to have list of channel
the only channels that work are those whose diaplayname begins with “Roma…” are 4 channels. All others channel doesnìt works when flutter try to get joinchannel for a user



{"ReturnCode":1,"ReturnValue":{"Payload":[{"_id":"650c46e9561b7e1d669bf96f","path":"649aab486f9a25a6bb94099d/chat/channel/650c46e9561b7e1d669bf96f","channelId":"TEST-226-000006-RTL","channelInternalId":"650c46e9561b7e1d669bf96f","channelPublicId":"TEST-226-000006-RTL","isDistinct":false,"metadata":{"ClientId":"226","Airport":"BGY","Category":"RTL"},"type":"standard","tags":null,"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Milan Bergamo Airport - Retail","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":0,"memberCount":1,"messageCount":0,"lastActivity":"2023-09-21T13:36:41.577Z","createdAt":"2023-09-21T13:36:41.577Z","updatedAt":"2023-09-21T13:36:41.577Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"650c46e902beb40be132eb06","path":"649aab486f9a25a6bb94099d/chat/channel/650c46e902beb40be132eb06","channelId":"TEST-226-000006-FB","channelInternalId":"650c46e902beb40be132eb06","channelPublicId":"TEST-226-000006-FB","isDistinct":false,"metadata":{"ClientId":"226","Airport":"BGY","Category":"FB"},"type":"standard","tags":null,"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Milan Bergamo Airport - Food&Beverage","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":0,"memberCount":1,"messageCount":0,"lastActivity":"2023-09-21T13:36:41.296Z","createdAt":"2023-09-21T13:36:41.296Z","updatedAt":"2023-09-21T13:36:41.296Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"650c3d2150f8f5e4f777dab5","path":"649aab486f9a25a6bb94099d/chat/channel/650c3d2150f8f5e4f777dab5","channelId":"TEST-011-000003-RTL","channelInternalId":"650c3d2150f8f5e4f777dab5","channelPublicId":"TEST-011-000003-RTL","isDistinct":false,"metadata":{"ClientId":"11","Airport":"VCE","Category":"RTL"},"type":"standard","tags":null,"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Venezia - Marco Polo - Retail","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":0,"memberCount":2,"messageCount":0,"lastActivity":"2023-09-21T12:54:57.221Z","createdAt":"2023-09-21T12:54:57.221Z","updatedAt":"2023-09-21T12:55:15.722Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"650c3d2050f8f5fb8a77daa6","path":"649aab486f9a25a6bb94099d/chat/channel/650c3d2050f8f5fb8a77daa6","channelId":"TEST-011-000003-FB","channelInternalId":"650c3d2050f8f5fb8a77daa6","channelPublicId":"TEST-011-000003-FB","isDistinct":false,"metadata":{"ClientId":"11","Airport":"VCE","Category":"FB"},"type":"standard","tags":null,"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Venezia - Marco Polo - Food&Beverage","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":0,"memberCount":2,"messageCount":0,"lastActivity":"2023-09-21T12:54:56.98Z","createdAt":"2023-09-21T12:54:56.98Z","updatedAt":"2023-09-21T12:55:10.634Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"6509adc4a1a98252a6411de6","path":"649aab486f9a25a6bb94099d/chat/channel/6509adc4a1a98252a6411de6","channelId":"TEST-130-000004-RTL","channelInternalId":"6509adc4a1a98252a6411de6","channelPublicId":"TEST-130-000004-RTL","isDistinct":false,"metadata":{"ClientId":"130","Airport":"BLQ","Category":"RTL"},"type":"standard","tags":null,"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Bologna - Guglielmo Marconi - Retail","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":0,"memberCount":2,"messageCount":0,"lastActivity":"2023-09-19T14:18:44.944Z","createdAt":"2023-09-19T14:18:44.944Z","updatedAt":"2023-09-21T12:50:05.614Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"6509adc4a1a98267d6411dae","path":"649aab486f9a25a6bb94099d/chat/channel/6509adc4a1a98267d6411dae","channelId":"TEST-130-000004-FB","channelInternalId":"6509adc4a1a98267d6411dae","channelPublicId":"TEST-130-000004-FB","isDistinct":false,"metadata":{"ClientId":"130","Airport":"BLQ","Category":"FB"},"type":"standard","tags":null,"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Bologna - Guglielmo Marconi - Food&Beverage","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":0,"memberCount":2,"messageCount":0,"lastActivity":"2023-09-19T14:18:44.703Z","createdAt":"2023-09-19T14:18:44.703Z","updatedAt":"2023-09-21T12:51:41.437Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"64ef09fb292e360f5ce02f93","path":"649aab486f9a25a6bb94099d/chat/channel/64ef09fb292e360f5ce02f93","channelId":"TEST-001-000001-RTL","channelInternalId":"64ef09fb292e360f5ce02f93","channelPublicId":"TEST-001-000001-RTL","isDistinct":false,"metadata":{"ClientId":"1","Airport":"FCO","Category":"RTL"},"type":"standard","tags":[],"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Roma - Fiumicino  - Retail","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":1000,"memberCount":4,"messageCount":10,"lastActivity":"2023-09-19T12:52:27.071Z","createdAt":"2023-08-30T09:20:59.398Z","updatedAt":"2023-09-19T12:52:27.136Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"64ef09cfde1848293e73bf8a","path":"649aab486f9a25a6bb94099d/chat/channel/64ef09cfde1848293e73bf8a","channelId":"TEST-001-000001-FB","channelInternalId":"64ef09cfde1848293e73bf8a","channelPublicId":"TEST-001-000001-FB","isDistinct":false,"metadata":{"ClientId":"1","Airport":"FCO","Category":"FB"},"type":"standard","tags":[],"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Roma - Fiumicino  - Food&Beverage","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":1000,"memberCount":2,"messageCount":1,"lastActivity":"2023-09-18T12:37:25.183Z","createdAt":"2023-08-30T09:20:15.076Z","updatedAt":"2023-09-18T12:37:25.318Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"64ef0a05292e367c22e03048","path":"649aab486f9a25a6bb94099d/chat/channel/64ef0a05292e367c22e03048","channelId":"TEST-001-000002-FB","channelInternalId":"64ef0a05292e367c22e03048","channelPublicId":"TEST-001-000002-FB","isDistinct":false,"metadata":{"ClientId":"1","Airport":"CIA","Category":"FB"},"type":"standard","tags":[],"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Roma - Ciampino - Food&Beverage","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":1000,"memberCount":2,"messageCount":0,"lastActivity":"2023-08-30T09:23:28.466Z","createdAt":"2023-08-30T09:21:09.038Z","updatedAt":"2023-09-20T16:08:20.027Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null},{"_id":"64ef0a05812066a55fc759aa","path":"649aab486f9a25a6bb94099d/chat/channel/64ef0a05812066a55fc759aa","channelId":"TEST-001-000002-RTL","channelInternalId":"64ef0a05812066a55fc759aa","channelPublicId":"TEST-001-000002-RTL","isDistinct":false,"metadata":{"ClientId":"1","Airport":"CIA","Category":"RTL"},"type":"standard","tags":[],"isMuted":false,"isRateLimited":false,"muteTimeout":"0001-01-01T00:00:00","rateLimit":0,"rateLimitWindow":1000,"rateLimitTimeout":"0001-01-01T00:00:00","displayName":"Roma - Ciampino - Retail","messageAutoDeleteEnabled":false,"autoDeleteMessageByFlagLimit":1000,"memberCount":2,"messageCount":0,"lastActivity":"2023-08-30T09:23:16.726Z","createdAt":"2023-08-30T09:21:09.815Z","updatedAt":"2023-09-20T16:07:03.98Z","avatarFileId":null,"isDeleted":false,"Airport":null,"Category":null,"ClientId":null}]},"ErrorDescription":null,"SuccessMessage":null,"AlertMessage":null,"OtherInfo":null}

Thank you for providing the json, this is very helpful. Let me pass this to our team to help check.

Hi, no good news about exception?

Hi think understand error, I created the channels with v2 and type=standard. If I create new channels with v3 type=community it’s works fine for all channels.
But it’s strange that come channels create with type=standard worked fine and some other channels not worked fine

1 Like

Thank you for the update, glad it’s working now. It’s possible that the v2 standard type is no longer available, which could indicate that it may not be fully functional.