Skip to content

The project uses a Market Trust Map and scan history, which are currently reliant on network connectivity. #148

Description

@kritikukreja6-create

Description

Currently, FreshScan AI requires a stable internet connection to perform scans and log data to Supabase. In many real-world market environments (where this tool is intended to be used), cellular connectivity can be unreliable.
I propose implementing a robust offline-first synchronization strategy to ensure that scanning remains functional even when the user is offline.
Proposed Implementation
Local Data Persistence: Integrate IndexedDB (via a library like Dexie.js) to cache scan results and Market Map data locally on the device when the network is unavailable.
Background Sync API: Utilize the Service Worker Background Sync API to queue failed POST requests (scans) and automatically replay them once the user regains connectivity.
Conflict Resolution: Implement a "Sync Status" indicator in the UI that provides feedback to the user on whether their scan is "Pending Sync," "Synced," or "Sync Failed."
Data Integrity: Given that this app deals with freshness indices, we must implement a deduplication layer to ensure that if a scan is queued multiple times, it only records a single entry once the connection returns.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions