Skip to content

Allow snapshot to be restored to a remote instance in dev mode#6679

Merged
knolleary merged 4 commits intomainfrom
6654-dev-mode-snapshot-restore
Feb 11, 2026
Merged

Allow snapshot to be restored to a remote instance in dev mode#6679
knolleary merged 4 commits intomainfrom
6654-dev-mode-snapshot-restore

Conversation

@knolleary
Copy link
Member

Closes #6654

This adds a forceUpdate flag to the status update sent to a device when changing the snapshot version manually (ie, not via a pipeline).

When running a device with FlowFuse/device-agent#570 applied, this will allow the snapshot to be applied even if in developer mode.

In the UI:

  • Updates the canDeploy logic that determines if the snapshot restore button is enabled so that if the device is in dev mode, but is running 3.8.0 (as yet unreleased), then the button should be enabled
  • Adds the ability to set a tooltop on the drawer action buttons - and does so for the restore button if it will be disabled to help the user know what's up
  • Relaxes the spacing of the Snapshot info table as it was very bunched up.

@knolleary knolleary requested a review from Steve-Mcl February 10, 2026 10:51
@knolleary knolleary changed the title 6654 dev mode snapshot restore Allow snapshot to be restored to a remote instance in dev mode Feb 10, 2026
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.65%. Comparing base (5965cc9) to head (79393ac).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
forge/db/controllers/Device.js 66.66% 1 Missing ⚠️
forge/routes/api/device.js 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6679      +/-   ##
==========================================
- Coverage   76.66%   76.65%   -0.01%     
==========================================
  Files         398      398              
  Lines       20103    20108       +5     
  Branches     4841     4844       +3     
==========================================
+ Hits        15411    15414       +3     
- Misses       4692     4694       +2     
Flag Coverage Δ
backend 76.65% <71.42%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

1 issue, 1 nitpick

Issue:

After deploying a snapshot something is not being refreshed locally preventing previously applied snapshot being deployed (even though my very last action was to deploy a different snapshot)

Image

To repicate ^

  1. Make snapshot 1
  2. Alter flows
  3. Make snapshot 2
  4. Refresh FF
  5. Restore snapshot 1 ✅
  6. Restore snapshot 2 ❌

After refreshing the FF app, it is permitted to be deployed.

Image

Nitpick

It is not obvious that work could be lost from the modal.

Image

Can we make this clear like the dev mode toggle?

Image

@knolleary
Copy link
Member Author

Restore snapshot 1 ✅
Restore snapshot 2 ❌
After refreshing the FF app, it is permitted to be deployed.

I think this is a timing issue. You are deploying snapshot 1, then fairly quickly asking to restore snapshot 2 - however the device is still updating to snapshot1 and has not yet reported back that it's running snapshot1 - so the platform thinks its active snapshot is still snapshot 2.

I'll try to reproduce, but with a longer delay between the restores to see if that theory is correct. If so, I think we can live with it.

@Steve-Mcl
Copy link
Contributor

Steve-Mcl commented Feb 10, 2026

I think this is a timing issue.

I dont think so unfortunately.

I took that gif about 20 mins ago then left it running.

It still happens.

chrome_PQjk2PvJtY

I had to refresh FF page then I could deploy Snapshot 1


EDIT

it is hard to tell from the GIF (since its a loop) but whats happening is:

  1. I try to send Snapshot 1 - get "Cannot" toast
  2. I go to the editor to see what is running - it is Snapshot 2
  3. I go back to FF and refresh
  4. I can now deploy Snapshot 1

@knolleary
Copy link
Member Author

  • Fixed the refresh of device details so the frontend knows the snapshot has changed.
  • Updated the dialog if in dev mode to include the warning about overwriting changes.
image

@Steve-Mcl ready for another review

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

Working well locally. Tested before and after merging main (with the new immersive experience)

@knolleary knolleary merged commit a4e7894 into main Feb 11, 2026
27 checks passed
@knolleary knolleary deleted the 6654-dev-mode-snapshot-restore branch February 11, 2026 13:50
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.

Add snapshot restore option to app-assigned remote instances

2 participants