Revision 12827 - 2021-01-19
The issue with disappearing ViewModel columns was debugged and fixed.
The issue was really that InAsyncThreadOrTheMainThreadInNonAsyncAppSoYouCanNeverGiveUp was sometimes left as false for some parallel threads performing the file write. This led to Enumerations that ran into longer locks and gave up, returning fewer results than they had—and this led to the file write writing incomplete data.
The reason for the Enumerations' ability to give up is the UI. The UI continues in an Async app and trusts that the Async thread eventually brings the missing data.
- This was probably also the issue behind the failing file saves from 2018 when it signaled failure and asked you to try again. This error was then wrongfully "fixed", leading to the much worse error of incomplete file writes (that is now fixed).
To ensure your application is NOT in any way suffering from giving up iterations of lists due to temporary locks, always set the InAsyncThreadOrTheMainThreadInNonAsyncAppSoYouCanNeverGiveUp like this:
AsyncServiceSupportThreadInfo.InAsyncThreadOrTheMainThreadInNonAsyncAppSoYouCanNeverGiveUp = true; // thread is no longer uninterruptible
public static class AsyncServiceSupportThreadInfo
{
/// <summary>
/// Will return true when called from a thread that is an active async-thread in an EcoSpace
/// </summary>
[ThreadStatic]
public static bool InAsyncThreadOrTheMainThreadInNonAsyncAppSoYouCanNeverGiveUp = true; // in NonAsync apps - main thread has same status as the async thread (uninterruptible)
}
