-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Ensure semantic model pages are built after tags are loaded #2066
Conversation
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@@ -175,6 +174,12 @@ export default { | |||
this.$store.dispatch('stopTrackingStates') | |||
}, | |||
onPageInit () { | |||
this.$store.subscribe((mutation, state) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghys This could also be placed in homecards-mixin.js
but it is only used by home.vue
and home-edit.vue
and I don't think we need this subscription for the edit page. I don`t think a user would want to update the semantic model tags and have the edit page open at the same time.
Do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - makes sense.
Job #1157: Bundle Size — 15.76MiB (~+0.01%).Metrics (1 change)
Total size by type (2 changes)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the investigation and the fix, nice to have some more debug logs too!
One thing that came to my mind just a few seconds ago and that we have to keep an eye on, is that in case the home page is destroyed and re-created, the model won‘t load. I made it to only load when the tags are saved, because otherwise the model would be loaded two times on app init. |
Fixes #2006. With the attempt in #2029 failing due to #2054, this finally fixes an issue where the semantic model pages (Equipment, Properties) were missing translations. This was due to a race condition, where the semantic model pages were built before the tags were loaded. This PR fixes this by watching for semantic model updates (i.e. subscripting to the underlying Vuex mutation) and loading/building the model pages after such an update. Futher improvements: - Initial loading of semantic tags is put in parallel with other API requests performed on app init. - Vuex semantics: A mutation is used for setting the semantic tags from the action. - Debug logging is added to both the semantic tag and the semantic model page loading. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com> (cherry picked from commit f2c008b)
…2066) Fixes openhab#2006. With the attempt in openhab#2029 failing due to openhab#2054, this finally fixes an issue where the semantic model pages (Equipment, Properties) were missing translations. This was due to a race condition, where the semantic model pages were built before the tags were loaded. This PR fixes this by watching for semantic model updates (i.e. subscripting to the underlying Vuex mutation) and loading/building the model pages after such an update. Futher improvements: - Initial loading of semantic tags is put in parallel with other API requests performed on app init. - Vuex semantics: A mutation is used for setting the semantic tags from the action. - Debug logging is added to both the semantic tag and the semantic model page loading. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com> Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
…2066) Fixes openhab#2006. With the attempt in openhab#2029 failing due to openhab#2054, this finally fixes an issue where the semantic model pages (Equipment, Properties) were missing translations. This was due to a race condition, where the semantic model pages were built before the tags were loaded. This PR fixes this by watching for semantic model updates (i.e. subscripting to the underlying Vuex mutation) and loading/building the model pages after such an update. Futher improvements: - Initial loading of semantic tags is put in parallel with other API requests performed on app init. - Vuex semantics: A mutation is used for setting the semantic tags from the action. - Debug logging is added to both the semantic tag and the semantic model page loading. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com> Signed-off-by: jgeorgi <justin.georgi@gmail.com>
…2066) Fixes openhab#2006. With the attempt in openhab#2029 failing due to openhab#2054, this finally fixes an issue where the semantic model pages (Equipment, Properties) were missing translations. This was due to a race condition, where the semantic model pages were built before the tags were loaded. This PR fixes this by watching for semantic model updates (i.e. subscripting to the underlying Vuex mutation) and loading/building the model pages after such an update. Futher improvements: - Initial loading of semantic tags is put in parallel with other API requests performed on app init. - Vuex semantics: A mutation is used for setting the semantic tags from the action. - Debug logging is added to both the semantic tag and the semantic model page loading. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com> Signed-off-by: jgeorgi <justin.georgi@gmail.com>
…2066) Fixes openhab#2006. With the attempt in openhab#2029 failing due to openhab#2054, this finally fixes an issue where the semantic model pages (Equipment, Properties) were missing translations. This was due to a race condition, where the semantic model pages were built before the tags were loaded. This PR fixes this by watching for semantic model updates (i.e. subscripting to the underlying Vuex mutation) and loading/building the model pages after such an update. Futher improvements: - Initial loading of semantic tags is put in parallel with other API requests performed on app init. - Vuex semantics: A mutation is used for setting the semantic tags from the action. - Debug logging is added to both the semantic tag and the semantic model page loading. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Fixes #2006.
With the attempt in #2029 failing due to #2054, this finally fixes an issue where the semantic model pages (Equipment, Properties) were missing translations.
This was due to a race condition, where the semantic model pages were built before the tags were loaded.
This PR fixes this by watching for semantic model updates (i.e. subscripting to the underlying Vuex mutation) and loading/building the model pages after such an update.
Futher improvements: