It was available normally before the update, but suddenly it doesn't work normally after the update. Help me.
Symptom: Enter ID, password and press login button -> return to login screen
DEBUG :
Exception Occurrences
tb_context.dart - onUserLoaded
Method
userPermissions = await tbClient.getUserPermissionsService().getAllowedPermissions();
An exception occurs when you enter the getAllowedPermissions
method and run the next part.
security_models.dart - MergedUserPermissions Class
readEntityPermissions = (json['readEntityPermissions'] as Map).map(
(key, value) => MapEntry(resourceFromString(key),
MergedGroupTypePermissionInfo.fromJson(value))),
exception caught in catch statement of onUserLoaded
method of TbContext
class in tb_context.dart
e: Bad state: No Element
#0 ListMixin.firstWhere (dart:collection/list.dart:167:5)
#1 resourceFromString (package:thingsboard_pe_client/src/model/security_models.dart:95:26)
#2 new MergedUserPermissions.fromJson.<anonymous closure> (package:thingsboard_pe_client/src/model/security_models.dart:192:38)
#3 MapMixin.map (dart:collection/maps.dart:170:28)
#4 new MergedUserPermissions.fromJson (package:thingsboard_pe_client/src/model/security_models.dart:191:72)
#5 new AllowedPermissionsInfo.fromJson (package:thingsboard_pe_client/src/model/security_models.dart:239:35)
#6 UserPermissionsService.getAllowedPermissions (package:thingsboard_pe_client/src/service/user_permissions_service.dart:20:35)
<asynchronous suspension>
#7 TbContext.onUserLoaded (package:nesics_by_tb/core/context/tb_context.dart:303:31)
<asynchronous suspension>
The console log has no specific content:
I/flutter ( 7401): DEBUG ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG │ 🐛 onUserLoaded: isAuthenticated=true
I/flutter ( 7401): DEBUG └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG │ 🐛 authUser: AuthUser{sub: ###@###.com, scopes: [CUSTOMER_USER], userId: ###, firstName: #, lastName: #, enabled: true, tenantId: #, customerId: #, isPublic: false, authority: CUSTOMER_USER, additionalData: {iss: thingsboard.cloud, iat: 1660714849, exp: 1660743649, isBillingService: false, privacyPolicyAccepted: true, termsOfUseAccepted: true}
I/flutter ( 7401): DEBUG └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG │ 🐛 On load started.
I/flutter ( 7401): DEBUG └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 7401): DEBUG │ 🐛 onUserLoaded: isAuthenticated=false
I/flutter ( 7401): DEBUG └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────