epoxy icon indicating copy to clipboard operation
epoxy copied to clipboard

Calling EpoxyController.notifyModelChanged() is causing a crash

Open blah1234 opened this issue 2 years ago • 0 comments
trafficstars

Is EpoxyController.notifyModelChanged() a supported API? If I try calling that method on a Typed2EpoxyController, in some cases it causes a crash. And looking at the code base, the crash path is clear:

EpoxyController.notifyModelChanged() -> requestModelBuild() -> and then Typed2EpoxyController throws the IllegalStateException():

public final void requestModelBuild() {
    if (!allowModelBuildRequests) {
      throw new IllegalStateException(
          "You cannot call `requestModelBuild` directly. Call `setData` instead to trigger a "
              + "model refresh with new data.");
    }
    super.requestModelBuild();
  }

blah1234 avatar Jul 31 '23 22:07 blah1234