Skip to content

[8080] Data Farm > Hosted Instances 2 - store + first consumer - #8151

Open
n-lark wants to merge 2 commits into
8079-df-instances-befrom
8080-df-instances-store
Open

[8080] Data Farm > Hosted Instances 2 - store + first consumer#8151
n-lark wants to merge 2 commits into
8079-df-instances-befrom
8080-df-instances-store

Conversation

@n-lark

@n-lark n-lark commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

See test plan #8080 (comment)

Related Issue(s)

Resolves #8080

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@n-lark n-lark self-assigned this Aug 7, 2026
@@ -356,36 +366,20 @@ export default {
this.abortController = controller
this.loading = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these are from the mixin that I'll remove in a follow up PR.

@@ -0,0 +1,157 @@
import { defineStore } from 'pinia'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@n-lark
n-lark requested a review from cstns August 7, 2026 18:26
@n-lark
n-lark marked this pull request as ready for review August 7, 2026 18:26
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.18%. Comparing base (d11cd9b) to head (5639d81).

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           
Flag Coverage Δ
backend 76.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant