airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.46k stars 730 forks source link

Calling EpoxyController.notifyModelChanged() is causing a crash #1361

Open blah1234 opened 11 months ago

blah1234 commented 11 months ago

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();
  }