Skip to content

Conversation

philon-
Copy link
Contributor

@philon- philon- commented Sep 18, 2025

Description

This PR implements persistence for device and app stores, ensuring that this information is retained across sessions.

Related Issues

Changes Made

  • Implements persistence for device store, similar to current NodeDBStore and MessageStore implementations
  • Implements persistence for the app store.
  • Modified the factory reset dialog to clear all data from current device and force client reload.
  • Minor clean up to NodeDBStore and MessageStore
  • Commented out irrelevant branch in Dashboard

Testing Done

Adds new unit tests to verify state and persistence functionality of the app and device store.

Screenshots (if applicable)

Checklist

  • Code follows project style guidelines
  • Documentation has been updated or added
  • Tests have been added or updated
  • All i18n translation labels have been added (read
    CONTRIBUTING_I18N_DEVELOPER_GUIDE.md for more details)

@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 15:49
Copy link

vercel bot commented Sep 18, 2025

@philon- is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements persistence for device and app stores, ensuring that this information is retained across sessions. It modernizes the store architecture with feature flag-controlled persistence and improves the factory reset functionality to properly clear all stored data.

Key changes include:

  • Added comprehensive persistence support for device and app stores using IndexedDB
  • Enhanced factory reset dialog to clear all stores and reload the client
  • Refactored store utilities to support both arrays and maps for data retention management

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/web/src/pages/Dashboard/index.tsx Temporarily commented out device listing functionality
packages/web/src/core/stores/utils/evictOldestEntries.ts Extended utility to handle both arrays and maps with function overloads
packages/web/src/core/stores/nodeDBStore/nodeDBStore.test.tsx Fixed optional chaining for test assertion
packages/web/src/core/stores/nodeDBStore/nodeDBStore.mock.ts Added missing mock methods for node cleanup
packages/web/src/core/stores/nodeDBStore/index.ts Restructured data types and extracted IDB key constant
packages/web/src/core/stores/messageStore/index.ts Restructured data types and extracted IDB key constant
packages/web/src/core/stores/index.ts Updated import paths with explicit file extensions
packages/web/src/core/stores/deviceStore/types.ts Extracted type definitions to separate file
packages/web/src/core/stores/deviceStore/index.ts Implemented comprehensive device store persistence
packages/web/src/core/stores/deviceStore/deviceStore.test.ts Added extensive test coverage for device store functionality
packages/web/src/core/stores/deviceStore/deviceStore.mock.ts Added missing myNodeNum property to mock
packages/web/src/core/stores/appStore/types.ts Extracted RasterSource type definition
packages/web/src/core/stores/appStore/index.ts Implemented app store persistence with feature flag support
packages/web/src/core/stores/appStore/appStore.test.ts Added comprehensive test coverage for app store
packages/web/src/core/services/featureFlags.ts Added feature flags for device and app persistence
packages/web/src/core/services/dev-overrides.ts Enabled new persistence features in development
packages/web/src/components/Dialog/FactoryResetDeviceDialog/FactoryResetDeviceDialog.tsx Enhanced to clear all stores and force client reload
packages/web/src/components/Dialog/FactoryResetDeviceDialog/FactoryResetDeviceDialog.test.tsx Updated tests for new factory reset behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

philon- and others added 2 commits September 18, 2025 17:55
Co-authored-by: Copilot <[email protected]>
@philon- philon- requested a review from danditomaso September 19, 2025 13:34
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