[bisq-network/bisq] Check if user has downgraded to an older version (#4829)

Stan notifications at github.com
Sat Nov 21 17:08:55 CET 2020


@ghubstan commented on this pull request.



> +            e.printStackTrace();
+        }
+        return null;
+    }
+
+    private static File getVersionFile() {
+        return new File(Config.appDataDir(), VERSION_FILE_NAME);
+    }
+
+    public static boolean hasDowngraded() {
+        return hasDowngraded(getLastBisqVersion());
+    }
+
+    public static boolean hasDowngraded(String lastVersion) {
+        return lastVersion != null && Version.isNewVersion(lastVersion, Version.VERSION);
+    }

Since this can't really be tested by downgrading from an older pkg, I hacked BisqSetup.java Line 531:

	public static boolean hasDowngraded(String lastVersion) {
		return true;
        // return lastVersion != null && Version.isNewVersion(lastVersion, Version.VERSION);
    }
    
It worked as expected, showing me a shutdown message & button, but I got an NPE after clicking the shutdown button.  I am not sure this is avoidable or very important, but think you'd want to know.

	Nov-21 13:28:17.176 [JavaFX Application Thread] ERROR bisq.core.app.BisqSetup: Downgrade from version 1.5.0 to version 1.5.0 is not supported 
	Nov-21 13:28:21.649 [Thread-3] INFO  bisq.core.app.BisqExecutable: Start graceful shutDown 
	Nov-21 13:28:21.659 [Thread-3] INFO  b.c.a.AvoidStandbyModeService: Stopped 
	Nov-21 13:28:21.659 [Thread-3] INFO  b.core.offer.OpenOfferManager: Remove open offers at shutDown. Number of open offers: 0 
	Nov-21 13:28:21.660 [Thread-3] INFO  bisq.core.app.BisqExecutable: OpenOfferManager shutdown completed 
	Nov-21 13:28:21.660 [Thread-3] INFO  bisq.core.app.BisqExecutable: WalletsSetup shutdown completed 
	Nov-21 13:28:21.664 [JavaFX Application Thread] INFO  b.n.p2p.network.NetworkNode: Shutdown immediately because no connections are open. 
	Nov-21 13:28:21.666 [Thread-3] INFO  b.n.p2p.network.TorNetworkNode: Tor has not been created yet. We cancel the torStartupFuture. 
	Nov-21 13:28:21.666 [Thread-3] ERROR b.n.p2p.network.TorNetworkNode: Shutdown torNetworkNode failed with exception: null 
	java.lang.NullPointerException
		at bisq.network.p2p.network.TorNetworkNode.torNetworkNodeShutDown(TorNetworkNode.java:187)
		at bisq.network.p2p.network.TorNetworkNode.shutDown(TorNetworkNode.java:154)
		at bisq.network.p2p.P2PService.doShutDown(P2PService.java:276)
		at bisq.network.p2p.peers.Broadcaster.doShutDown(Broadcaster.java:81)
		at bisq.network.p2p.peers.Broadcaster.shutDown(Broadcaster.java:68)
		at bisq.network.p2p.P2PService.shutDown(P2PService.java:244)
		at bisq.core.app.BisqExecutable.lambda$gracefulShutDown$4(BisqExecutable.java:245)
		at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
		at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
		at javafx.beans.property.BooleanPropertyBase.fireValueChangedEvent(BooleanPropertyBase.java:104)
		at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
		at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
		at bisq.core.btc.setup.WalletsSetup.shutDown(WalletsSetup.java:344)
		at bisq.core.app.BisqExecutable.lambda$gracefulShutDown$5(BisqExecutable.java:260)
		at bisq.core.offer.OpenOfferManager.shutDown(OpenOfferManager.java:232)
		at bisq.core.app.BisqExecutable.gracefulShutDown(BisqExecutable.java:234)
		at bisq.desktop.app.BisqApp.lambda$stop$1(BisqApp.java:148)
		at java.base/java.lang.Thread.run(Thread.java:834)
	Nov-21 13:28:26.668 [JavaFX Application Thread] ERROR b.n.p2p.network.TorNetworkNode: A timeout occurred at shutDown 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4829#pullrequestreview-535976570
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201121/2c426ef9/attachment-0001.html>


More information about the bisq-github mailing list