Repository: MycroftAI/mycroft-core

Issue:
mycroft "devices" web UI doesn't show core version

Version/setup same as MycroftAI/mycroft-core#2523 2523

## Try to provide steps that we can use to replicate the Issue

Hit up https://account.mycroft.ai/devices
![Selection_039](https://user-images.githubusercontent.com/6778269/78091868-20c38b80-739c-11ea-8934-e592838e8ab3.png)

## Provide log files or other output to help us see the error

N/A TBD (can help investigate let me know how) per the ref'd ticket the "self support" method didn't work


Discussion:
Thanks for reporting. Does this populate after a restart?

The data is sent at startup of the skills process and as part of the pairing process. I think this is a backend issue so I'll move the issue there.
Indeed I tried a restart once (stop & start).  Checked again this morning and it had yet to populate.
Thanks for the update.

For reference my devices (that show connected) all has the version info.
Just tested again; when it is off, it shows disconnected, and on, shows connected;
But the core version is not updated.
Moving this back to mycroft-core, a desktop install doesn't have a versionfile making the version show unknown. So while sending the info it doesn't contain anything, core should fall back to internally stored version.

Resolving patch:
diff --git a/mycroft/version/__init__.py b/mycroft/version/__init__.py
--- a/mycroft/version/__init__.py
+++ b/mycroft/version/__init__.py
@@ -45,7 +45,7 @@ def get():
                     return json.load(f)
             except Exception:
                 LOG.error("Failed to load version from '%s'" % version_file)
-        return {"coreVersion": None, "enclosureVersion": None}
+        return {"coreVersion": CORE_VERSION_STR, "enclosureVersion": None}
 
 
 def check_version(version_string):


Test patch:
diff --git a/test/unittests/version/test_version.py b/test/unittests/version/test_version.py
--- a/test/unittests/version/test_version.py
+++ b/test/unittests/version/test_version.py
@@ -13,10 +13,9 @@
 # limitations under the License.
 #
 import unittest
-
 from unittest.mock import mock_open, patch
 
-import mycroft.version
+from mycroft.version import check_version, CORE_VERSION_STR, VersionManager
 
 
 VERSION_INFO = """
@@ -34,32 +33,36 @@ def test_get_version(self):
 
             Assures that only lower versions return True
         """
-        self.assertTrue(mycroft.version.check_version('0.0.1'))
-        self.assertTrue(mycroft.version.check_version('0.8.1'))
-        self.assertTrue(mycroft.version.check_version('0.8.20'))
-        self.assertFalse(mycroft.version.check_version('0.8.22'))
-        self.assertFalse(mycroft.version.check_version('0.9.12'))
-        self.assertFalse(mycroft.version.check_version('1.0.2'))
+        self.assertTrue(check_version('0.0.1'))
+        self.assertTrue(check_version('0.8.1'))
+        self.assertTrue(check_version('0.8.20'))
+        self.assertFalse(check_version('0.8.22'))
+        self.assertFalse(check_version('0.9.12'))
+        self.assertFalse(check_version('1.0.2'))
 
     @patch('mycroft.version.isfile')
     @patch('mycroft.version.exists')
     @patch('mycroft.version.open',
            mock_open(read_data=VERSION_INFO), create=True)
-    def test_version_manager(self, mock_exists, mock_isfile):
-        """
-            Test mycroft.version.VersionManager.get()
+    def test_version_manager_get(self, mock_exists, mock_isfile):
+        """Test mycroft.version.VersionManager.get()
 
-            asserts that the method returns expected data
+        Asserts that the method returns data from version file
         """
         mock_isfile.return_value = True
         mock_exists.return_value = True
 
-        version = mycroft.version.VersionManager.get()
+        version = VersionManager.get()
         self.assertEqual(version['coreVersion'], "1505203453")
         self.assertEqual(version['enclosureVersion'], "1.0.0")
 
-        # Check file not existing case
+    @patch('mycroft.version.exists')
+    def test_version_manager_get_no_file(self, mock_exists):
+        """Test mycroft.version.VersionManager.get()
+
+        Asserts that the method returns current version if no file exists.
+        """
         mock_exists.return_value = False
-        version = mycroft.version.VersionManager.get()
-        self.assertEqual(version['coreVersion'], None)
+        version = VersionManager.get()
+        self.assertEqual(version['coreVersion'], CORE_VERSION_STR)
         self.assertEqual(version['enclosureVersion'], None)