-
Notifications
You must be signed in to change notification settings - Fork 0
PWA Updates
Keep StepSyncAI Fresh: Understanding Automatic Updates
StepSyncAI is a Progressive Web App (PWA), which means it works like a native app with offline support and lightning-fast loading. Here's how updates happen behind the scenes:
- Every 60 seconds, the app quietly checks if a new version is available
- When we deploy updates (new features, bug fixes, improvements), the app detects them automatically
- No manual action needed - it just works! β¨
When a new version is ready, you'll see a friendly notification in the bottom-right corner:
β¨ Update Available
A new version of StepSyncAI is ready!
[Reload] [Γ]
What to do:
- Click "Reload" to instantly update to the latest version (takes 1 second)
- Click "Γ" to dismiss and update later (notification auto-hides after 30 seconds)
That's it! No app store, no downloads, no waiting. π
- Connected to WiFi/mobile data? You'll get the latest code on your next visit automatically
- Tab open in background? The notification appears as soon as new code is detected (within 60 seconds)
- Actively using the app? Notification pops up when ready - finish what you're doing, then click "Reload"
- Updates deploy β Within 60 seconds, your app knows about it
- You click "Reload" β Instant update (less than 1 second)
- You're offline? No problem - update waits until you're back online
β
New features and improvements
β
Bug fixes and performance enhancements
β
Security patches
β
UI/design changes
β
All app functionality
Symptoms: Page loads but looks broken, no styles, plain white background
Quick Fix (try these in order):
-
Simple reload: Press
F5or click the reload button - Close and reopen: Close the tab/window and open StepSyncAI again
-
Clear service worker (advanced):
- Open browser Developer Tools (
F12orRight-click β Inspect) - Go to Application tab (Chrome/Edge) or Storage tab (Firefox)
- Click Service Workers in left sidebar
- Click "Unregister" next to
service-worker.js - Close DevTools and reload the page
- Open browser Developer Tools (
Why this happens: Very rare, but can occur if an update is interrupted mid-download. The new service worker fixes this permanently!
If you think there's an update but don't see the notification:
-
Check console logs:
- Open DevTools (
F12) - Go to Console tab
- Look for messages like
[SW] Activating new service worker version: stepsync-v5-quick-wins - If you see a new version number, just reload the page
- Open DevTools (
-
Force update check:
- DevTools β Application tab β Service Workers
- Click "Update" button
- Wait 5 seconds, then reload
-
Still stuck? See Get Help below
Expected behavior:
- β App should load and work offline (read existing data, view charts)
- β New data won't sync until you're back online (this is normal)
If app won't load at all offline:
- First visit must be online: Service worker needs to cache assets initially
- Try visiting online first, then go offline and test again
- Check storage: Some browsers limit storage in Private/Incognito mode
β
View your data: All mood logs, medications, sleep, exercise
β
View charts: Wellness trends and historical data
β
Use the app: Full UI and navigation
β
Add new entries: Mood, sleep, exercise (saves locally)
β First-time load: Initial visit must be online
β External resources: Chart.js library (cached after first load)
β Updates: New versions require internet to download
- First visit (online): App caches core files (HTML, CSS, JS)
- Subsequent visits (online or offline): Loads from cache instantly
- Going offline: Continue using with cached data
- Back online: Automatic sync (future feature - currently all data is local)
A: That means we've shipped exciting new features, bug fixes, or improvements! We're constantly making StepSyncAI better. Clicking "Reload" takes 1 second and gives you the newest version with all the latest goodies. π
A: Yes! After your first visit (which must be online), you can use the app completely offline. All your data is stored locally on your device, so mood tracking, medication management, charts, and insights work perfectly without internet.
Note: You'll need internet to get app updates or if we add cloud sync features in the future.
A: This is very rare with our new service worker (updated January 2026). If it happens:
-
First try: Simple reload (
F5orCmd+R) -
Still broken? Hard refresh (
Shift+F5orCmd+Shift+R) - Nuclear option: Clear service worker (see Troubleshooting above)
Pro tip: If you see the update notification, always click "Reload" - it prevents any potential issues!
A: Open browser DevTools (F12) β Console tab. Look for a message like:
[App] Service Worker registered
[SW] Installing new service worker version: stepsync-v5-quick-wins
The version name tells you what release you're on. We increment this with every deployment.
Current version: stepsync-v5-quick-wins (as of January 2026)
A: Never! Updates only refresh the app code (HTML, CSS, JavaScript). Your personal data (mood logs, medications, sleep, exercise) is stored separately in your browser's local storage and is 100% preserved across all updates.
A: Nope! StepSyncAI is a web app that runs in your browser. No App Store, no downloads, no permissions.
Optional: You can "install" it to your home screen for a native app experience:
- Desktop: Look for the install icon in your browser's address bar
- Mobile: Tap "Share" β "Add to Home Screen"
This is purely cosmetic - the app works the same in-browser or installed.
A: Think of it as a helpful robot π€ that lives in your browser. Its jobs:
- Cache files so the app loads instantly
- Check for updates every 60 seconds
- Enable offline mode by serving cached files when you have no internet
- Notify you when new versions are available
You never see it working - it just makes everything faster and smoother!
A: (For the technically curious)
-
Network-first (HTML/CSS/JS): Always try to get the latest code from the server. This prevents stale UI bugs and ensures you get updates quickly. Only falls back to cache if you're offline.
-
Cache-first (images/fonts): These rarely change, so loading from cache is faster. Saves bandwidth and improves performance.
Result: You get fresh app code instantly + lightning-fast performance. Best of both worlds! β‘
File: docs/service-worker.js
Current version: stepsync-v5-quick-wins
Caching strategy:
// Network-first (always fresh)
- HTML files (index.html, etc.)
- CSS stylesheets
- JavaScript files
// Cache-first (performance)
- Images (png, jpg, svg, etc.)
- Fonts (woff, woff2, ttf, etc.)
- Other static assetsLifecycle:
-
Install: Cache core assets, call
skipWaiting()for immediate activation -
Activate: Delete old cache versions, call
clients.claim()to take control - Fetch: Serve requests using strategy based on file type
-
Update check: Runs every 60 seconds via
setInterval()inindex.html
Message passing:
// Service worker β App
navigator.serviceWorker.postMessage({
type: 'SW_UPDATED',
version: 'stepsync-v5-quick-wins'
});
// App β User
showUpdateNotification(); // Displays "Update Available" toastCache versioning:
- Increment
CACHE_VERSIONon every deploy - Old caches automatically deleted in
activateevent - Format:
stepsync-v{number}-{description} - Example:
stepsync-v5-quick-winsβstepsync-v6-bug-fixes
Debugging:
// Console logs at each stage
[SW] Installing new service worker version: stepsync-v5-quick-wins
[SW] Caching core assets
[SW] Skipping waiting - activating immediately
[SW] Activating new service worker version: stepsync-v5-quick-wins
[SW] Deleting old cache: stepsync-v4-premium-ui-redesign
[SW] Claiming all clients
[App] Service Worker registered
[App] New version available: stepsync-v5-quick-winsTesting updates locally:
# 1. Make changes to code
# 2. Increment CACHE_VERSION in service-worker.js
# 3. In DevTools Application tab:
# - Check "Update on reload"
# - Reload page
# - Verify new version in console
# - Test update notification appearsPerformance metrics:
- Update detection: < 60 seconds
- Update download: < 1 second (typical)
- Cache cleanup: Automatic on activation
- Offline fallback: Instant (from cache)
If you experience persistent problems with updates or offline mode:
- Check existing issues: GitHub Issues
-
Open a new issue: Include:
- Browser name and version
- Operating system
- Steps to reproduce
- Console logs (DevTools β Console tab)
- Service worker status (DevTools β Application β Service Workers)
- GitHub Discussions: Ask questions
- Discord (coming soon): Real-time help from the community
- Email: Create an issue for private matters
When reporting update-related issues, please provide:
Browser: Chrome 120.0.6099.129 (example)
OS: macOS 14.2 (example)
Service Worker Status: Activated and running
Cache Version: stepsync-v5-quick-wins
Error: [paste error message from console]
How to find this:
- Open DevTools (
F12) - Console tab: Copy any error messages
- Application tab β Service Workers: Screenshot the status
-
Console tab: Look for
[SW] Activating new service worker version: ...
- Quick Start Guide - Get started with StepSyncAI
- Architecture - Technical details and system design
- Security & Privacy - Your data is safe and local
- FAQ - General questions about features and usage
Updates are automatic, fast, and hassle-free. Just click "Reload" when the notification appears, and you're always on the latest version!
Questions? Open an issue on GitHub or check the main FAQ.
Last Updated: January 9, 2026
Service Worker Version: v5-quick-wins
Update Strategy: Network-first for app code, cache-first for static assets