[8080] Data Farm > Hosted Instances 2 - store + first consumer - #8151
[8080] Data Farm > Hosted Instances 2 - store + first consumer#8151n-lark wants to merge 2 commits into
Conversation
| @@ -356,36 +366,20 @@ export default { | |||
| this.abortController = controller | |||
| this.loading = true | |||
There was a problem hiding this comment.
Had to keep unique loading state for this component since it fires when pagination/sorting/filters/etc fires.
We don't want this on the ff-page since it would reload the entire screen each time the pagination/sorting/filters/etc changed.
| </div> | ||
| <template v-if="!statusChannelLive"> | ||
| <InstanceStatusPolling v-for="instance in instances" :key="instance.id" :instance="instance" @instance-updated="instanceUpdated" /> | ||
| <InstanceStatusPolling v-for="instance in currentPageInstanceRefs" :key="instance.id" :instance="instance" @instance-updated="instanceUpdated" /> |
There was a problem hiding this comment.
Had to add currentPageInstanceRefs for the polling loop.
InstanceStatusPolling watches its instance prop by reference, and the decorated rows are new objects every recompute, so it kept resetting its poll timer and stalling. Using a stable ref fixes.
| this.instancesMap.set(newData.id, { | ||
| ...this.instancesMap.get(newData.id), | ||
| ...newData | ||
| async instanceStart (instance) { |
There was a problem hiding this comment.
All these are from the mixin that I'll remove in a follow up PR.
| @@ -0,0 +1,157 @@ | |||
| import { defineStore } from 'pinia' | |||
There was a problem hiding this comment.
This store is a little different from the other data-farm stores since the instances list is server-paginated/searched/sorted, so it can't cache-and-serve. Each query refetches and the store only holds the current page.
The more traditional farming patterns will be established in follow-ups for the other use cases.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8079-df-instances-be #8151 +/- ##
=====================================================
Coverage 76.18% 76.18%
=====================================================
Files 440 440
Lines 23613 23613
Branches 6289 6289
=====================================================
Hits 17990 17990
Misses 5623 5623
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…df-instances-store
Description
See test plan #8080 (comment)
Related Issue(s)
Resolves #8080
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel