Exception on getting the Feed?

Hello
Following exception
What is the problem?
What can I do prevent?
How can I bypass the exception?

‘package:get_it/get_it_impl.dart’: Failed assertion: line 434 pos 9: ‘instanceFactory.isReady’: You tried to access an instance of DBClient that is not ready yet

#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2 _GetItImplementation.get (package:get_it/get_it_impl.dart:434:9)
#3 _GetItImplementation.call (package:get_it/get_it_impl.dart:461:12)
#4 SdkServiceLocator.initServiceLocator. (package:amity_sdk/src/core/service_locator/sdk_service_locator.dart:78:64)
#5 _GetItImplementation._register. (package:get_it/get_it_impl.dart:1057:48)
#6 _rootRunUnary (dart:async/zone.dart:1407:47)#7 _CustomZone.runUnary (dart:async/zone.dart:1308:19)

Hi, for us to help identify the issue, please help provide more information:

  • sdk version
  • steps to reproduce/what function was called
  • relevant code
    Thank you.

Amity version: “0.24.0”
It’s in my App I don’t know where
I sent you the stack it suppose to help

May I confirm, which feed did you get this exception? community/user/global feed?

At this phase/time I’m using only community

  amityPostController = PagingController(
    pageFuture: (token) =>
        AmitySocialClient.newPostRepository()
            .getPosts()
            .targetCommunity(AmityServices.currentCommunityID)
            .feedType(AmityFeedType.PUBLISHED)
            .includeDeleted(false)
            .types(_dataType)
            .tags(_tags)
            .sortBy(_sortOption)
            .onlyParent(true)
            .getPagingData(token: token, limit: GlobalConstant.pageSize),
    pageSize: GlobalConstant.pageSize,
  )
    ..addListener(
          () {
        if (amityPostController.error == null) {
          setState(() {
            amityPosts.clear();
            amityPosts.addAll(amityPostController.loadedItems);
          });
        } else {
          //Error on pagination controller
          setState(() {});
          ErrorDialog.show(context,
              title: 'Error', message: amityPostController.error.toString()+" (3)");
        }
      },
    );
1 Like