ECS3 Offline Context Aware Shop Offers - ISIS3510-MOBILE-T34/T34-Wiki-SpendiQ GitHub Wiki

F3 - Offline Context-Aware Shop Offers

Attribute Details
Title/ID F3 - Offline Context-Aware Shop Offers
Event Description When the user is offline and enters the Special Offers section of the SpendiQ app, which serves as the context-aware system, they are informed that updated offers cannot be fetched due to the lack of internet connection.
System Response - Offline Notification:
  - A note appears at the top of the screen stating that the user is offline and Special Offers cannot be updated.
  - The note is visible only in the Special Offers section.

- Cached Offers Display:
  - The app displays the last cached list of special offers, including complete details like images and distances, calculated locally using the GPS.

- Caching Strategy:
  - Every 10 minutes, the app fetches the most updated offers (within 1 km of the user's location) from Firebase and replaces the locally stored data.

- Reconnection Behavior:
  - Once the internet connection is restored, the note disappears, and the app fetches and displays the latest offers from Firebase.
Possible Antipatterns - Stale Data Presentation:
  - Users may see outdated offers when offline.
- Silent Failures:
  - Risk of users not realizing their offers are not updated unless properly notified.
- Battery Drain:
  - Regular GPS usage and background syncing every 10 minutes could drain the device battery.
- Data Overwrites:
  - Replacing cached data every 10 minutes might lead to loss of useful historical data.
Caching and Retrieving Strategy - Caching:
  - Cache the latest special offers list locally every 10 minutes, replacing the previous cache.
  - Store complete offer details, including images and location metadata.

- Retrieving:
  - When offline, retrieve cached data to show offers in the Special Offers section.
  - Automatically fetch new data from Firebase once internet is available.
Storage Type - Local Storage:
  - Store cached special offers (including images and metadata).

- Remote Storage:
  - Firebase for fetching and storing special offers data, including store locations, distances, and offer details.
Stored Data Type - Offers Data:
  - Store names, offer details, images, and distances.

- Location Data:
  - User's current GPS coordinates for calculating proximity to stores.

- Offline Interaction Data:
  - Track offline interactions with offers (stored locally and synced when online).

Justification:

This scenario leverages a Network Falling Back to Cache strategy to ensure users receive reliable and location-relevant data, even offline. The caching approach ensures users can access important offers while minimizing performance impact and maintaining a smooth user experience.

⚠️ **GitHub.com Fallback** ⚠️