-
Notifications
You must be signed in to change notification settings - Fork 259
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
[Bug]: Campaign sometimes unloaded immediately after loading. #4542
Comments
Okay, so the lib:token missing error that I get with the attached campaign is the reason that campaign is consistently dropped. It stops being consistent at 15ebc6c, I assume due to some differences in error handling (haven't actually looked at it). But the issue exists regardless, that errors is a result of the underlying problem, it's not the cause. This seems be the rough startup sequence causing the problem:
Since (2.iv) runs on the EDT thread, if we get there before the client message handler queues its EDT action for the first We can make this problem consistent by simulating a delay in the client message handling thread, e.g.: diff --git a/src/main/java/net/rptools/maptool/client/ClientMessageHandler.java b/src/main/java/net/rptools/maptool/client/ClientMessageHandler.java
index a87961324..26bc98232 100644
--- a/src/main/java/net/rptools/maptool/client/ClientMessageHandler.java
+++ b/src/main/java/net/rptools/maptool/client/ClientMessageHandler.java
@@ -630,6 +630,10 @@ private void handle(SetCampaignNameMsg msg) {
}
private void handle(SetCampaignMsg msg) {
+ try {
+ Thread.sleep(1000);
+ } catch (Exception e) {
+ }
EventQueue.invokeLater(
() -> {
Campaign campaign = Campaign.fromDto(msg.getCampaign()); Increase the delay if loading a larger campaign that itself takes a while to load. |
You missed a step, the default campaign is actually created twice. Not sure if it is relevant. It's been bugging me for months but I haven't got around to fixing it yet. |
Describe the Bug
Sometimes when I open a campaign, it opens and shows a map for a moment before disappearing and being replaced with a blank campaign. No errors are shown or logged.
To Reproduce
Expected Behaviour
The selected campaign should remain open until I replace it.
Screenshots
No response
MapTool Info
1.14.1
Desktop
Linux Mint 21.2
Additional Context
Not all campaigns have this issue, but I don't know yet what makes the difference. Here is a test campaign of mine that consistently shows the problem for me: 4354-graaljs.cmpgn.renamed-to.zip In this campaign there is an error that comes up, but it seems to be a symptom of the campaign be unloaded rather than a problem in its own right.
I remember hitting this issue a week or so ago when opening a campaign from within MapTool instead of from the file explorer. But I tried to reproduce it now and couldn't, so I'm not sure anymore if I'm right about that.
The text was updated successfully, but these errors were encountered: