2sic / 2sxc

DNN + 2sxc = #DNNCMS - This tool helps web designers and developers prepare great looking content in DNN (DotNetNuke). It's like mixing DNN with Umbraco and Drupal :)
http://2sxc.org
MIT License
145 stars 39 forks source link

Bug: In some random cases errors appear IServiceProvider Disposed #3387

Closed iJungleboy closed 3 months ago

iJungleboy commented 3 months ago

I'm submitting a

[x] bug report => search github for a similar issue before submitting

...about

[x] Content Types or data management [x] internals

Current Behavior / Expected Behavior

In fairly random scenarios, errors appear in the style of Cannot Access Disposed object Object name: IServiceProvider.

image

After extensive research it appears that this is because of Ghost content types accessing metadata of their parent app, and some changes in the API around AppState resulted in using Dependency Injection much later, after the initial setup had been completed and it had been disposed.

Should be fixed now.

Instructions to Reproduce the Problem

  1. Find an app which has Ghost content types
  2. open the app admin - data tab and go somewhere with ghost-items - could be a special scope
  3. in another tab, log out
  4. restart the application (leave the app-data tab open)
  5. reload app-data so you get a not-authorized error. This somehow only loads part of the data, so that further loading will be delayed.
  6. Now log on again in the other tab
  7. then refresh the app-data. This will then try to load the remaining data "lazy" and fail.

Your environment

iJungleboy commented 3 months ago

it appears the problem was different.

Apparently it was because IView objects were being cached once created, but they kept a lazy-service which stopped working after the initial IServiceProvider was disposed after filling the cache.