Skip to content

fix: Improve safety, security, and stability#77

Merged
AdamJ merged 1 commit intomainfrom
claude/improve-safety-security-n4llD
Mar 25, 2026
Merged

fix: Improve safety, security, and stability#77
AdamJ merged 1 commit intomainfrom
claude/improve-safety-security-n4llD

Conversation

@AdamJ
Copy link
Copy Markdown
Owner

@AdamJ AdamJ commented Mar 25, 2026

Security:

  • Remove unverified third-party script (cdn.gpteng.co/gptengineer.js)
  • Add Content Security Policy meta tag (connect-src, frame-src, object-src, base-uri)
  • Patch 12 high-severity npm vulnerabilities via audit fix + overrides
  • Move Gemini API calls server-side via Supabase Edge Function (ai-proxy);
    VITE_GEMINI_API_KEY no longer exposed to the browser

Stability:

  • Wrap all localStorage.setItem calls in try-catch to handle QuotaExceededError
    and private/incognito mode (Safari) without crashing
  • Fix beforeunload handler: async save replaced with synchronous localStorage
    write as a crash-safe backup (async saves cannot be awaited on page unload)
  • Replace Promise.all with Promise.allSettled in forceSyncToDatabase so a single
    failed save no longer silently leaves other data in an inconsistent state
  • Show destructive toast when endDay save fails instead of only logging to console
  • Add private requireUser() helper in SupabaseService to validate user ID before
    every DB operation; removes scattered inconsistent null-check pattern
  • Wrap localStorage access in InstallPrompt in try-catch for private mode safety
  • Sanitize chart ID and color values before interpolation into dangerouslySetInnerHTML
  • Add SCHEMA_VERSION stamp to all localStorage writes; version mismatch on read
    clears stale data and returns safe defaults instead of passing corrupt state
    through the application; legacy bare-array format remains readable

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 25, 2026

Deploying timetrackerpro with  Cloudflare Pages  Cloudflare Pages

Latest commit: b976d8f
Status: ✅  Deploy successful!
Preview URL: https://ac616cca.timetrackerpro.pages.dev
Branch Preview URL: https://claude-improve-safety-securi.timetrackerpro.pages.dev

View logs

Security:
- Remove unverified third-party script (cdn.gpteng.co/gptengineer.js)
- Add Content Security Policy meta tag (connect-src, frame-src, object-src, base-uri)
- Patch 12 high-severity npm vulnerabilities via audit fix + overrides
- Move Gemini API calls server-side via Supabase Edge Function (ai-proxy);
  VITE_GEMINI_API_KEY no longer exposed to the browser

Stability:
- Wrap all localStorage.setItem calls in try-catch to handle QuotaExceededError
  and private/incognito mode (Safari) without crashing
- Fix beforeunload handler: async save replaced with synchronous localStorage
  write as a crash-safe backup (async saves cannot be awaited on page unload)
- Replace Promise.all with Promise.allSettled in forceSyncToDatabase so a single
  failed save no longer silently leaves other data in an inconsistent state
- Show destructive toast when endDay save fails instead of only logging to console
- Add private requireUser() helper in SupabaseService to validate user ID before
  every DB operation; removes scattered inconsistent null-check pattern
- Wrap localStorage access in InstallPrompt in try-catch for private mode safety
- Sanitize chart ID and color values before interpolation into dangerouslySetInnerHTML
- Add SCHEMA_VERSION stamp to all localStorage writes; version mismatch on read
  clears stale data and returns safe defaults instead of passing corrupt state
  through the application; legacy bare-array format remains readable

https://claude.ai/code/session_01JorBRWb89cm8BakhSoeWVx
@AdamJ AdamJ force-pushed the claude/improve-safety-security-n4llD branch from 413e807 to b976d8f Compare March 25, 2026 14:13
@AdamJ AdamJ changed the title Improve safety, security, and stability fix: Improve safety, security, and stability Mar 25, 2026
@AdamJ AdamJ merged commit 6ab4256 into main Mar 25, 2026
2 checks passed
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.

2 participants