New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error screen does not work if the app crashes very quickly after launching #3
Comments
@haroldadmin does this mean that issue is in app startup library ? |
verified using debugger that whatthestack is getting initialised first but the service starting is taking the time. |
You got it right, the problem occurs because the service takes a short while to start. The issue has been open for so long because, unfortunately, I have not found a good solution for it. |
Here is a possible way:
|
I'll have to verify if the app crash halts the service's startup process, otherwise serializing the crash for later consumption is a nice idea. Can't promise an ETA :) |
I experimented with the idea of serializing the crash for deferred use in the service. I opted to use a JSON file in the app's private directory because:
Here's the system I implemented:
The idea was that now the This system works, but unreliably. It missed roughly 1 out of every 5 crashes, and I suspect that's down to multi-process file IO synchronization issues. It's a neat solution to the problem in theory, but falls apart in reliability. I might experiment with DB-based serialization in the future. An important observation from this experiment was that the service continues its init process as usual even if the main application crashes. |
Maybe instead of file observer, you could rely on service like in the current version + polling the file for first couple of seconds (until service is connected)? |
The library relies on a service running in a different process to process and display the error screen. This means that if the application crashes immediately after start, the service might not get enough time to be prepared for accepting new messages.
Unfortunately it looks like there is no easy solution for this problem.
The text was updated successfully, but these errors were encountered: