Skip to content

Conversation

@jurb
Copy link
Collaborator

@jurb jurb commented Oct 9, 2025

Summary

Fixes localStorage-related bugs that caused issues when users restarted flows. Adds TTL expiration and proper state clearing at flow entry points.

Changes

  • Add 30-minute TTL to sessionStore and apiStore to prevent stale data from persisting
  • Fix memory leaks in getSessionId() and getLatestResponse() by using Svelte's get() helper instead of creating subscriptions
  • Clear all state when entering flow roots (/1 and /2) on mount using Svelte 5 $effect pattern
  • Auto-expire old sessions and API responses on load
  • when testing locally, use local whisper if API key is not set

Technical Details

  • Used Svelte 5 $effect with initialization flag for one-time setup on mount
  • Sessions and API responses now expire after 30 minutes automatically
  • Entry points properly clear session/API data and reset language to Dutch
  • Fixed subscription memory leaks that could cause performance issues

Testing

  • Verified state clears when navigating back to /1 or /2
  • Confirmed expired data is automatically cleaned up on page load
  • Tested that recent data (within TTL window) survives page refresh

kapsterdam and others added 14 commits September 23, 2025 15:48
…fix-draft

fixed arguments for make_chain
Restore internationalization functionality that was lost during recent merges:
- Add missing model creation imports to templates.py
- Update _yap_generate() to use language-specific models and prompts
- Fix _yap_check_finished() to use localized completion keywords
- Restore local Whisper fallback when TRANSCRIPTION_API_KEY is missing

Fixes TypeError: _yap_generate() takes 3 positional arguments but 4 were given
Fixes NameError: name 'GemeenteTurnModel' is not defined
Fixes RuntimeError: TRANSCRIPTION_API_KEY not set
- Add 30-minute TTL to sessionStore and apiStore to prevent stale data
- Fix memory leaks in getSessionId() and getLatestResponse() by using get()
- Clear all state when entering flow roots (/1 and /2) on mount
- Use Svelte 5 $effect pattern with initialization flag for one-time setup
- Auto-expire old sessions and API responses on load
@jurb jurb requested a review from kapsterdam October 9, 2025 11:32
@jurb jurb closed this Oct 9, 2025
@jurb
Copy link
Collaborator Author

jurb commented Oct 9, 2025

ik heb denk ik een fout gemaakt, want hier zitten veel meer commits bij dan de bedoeling was

@jurb
Copy link
Collaborator Author

jurb commented Oct 9, 2025

@kapsterdam Nee is denk ik toch ok: ik heb veranderingen aan het backend gemaakt en teruggedraaid, en jouw bugfix-draft branch erin gemerged, en lokaal getest. Dus ik denk dat met deze pull request zowel backend als frontend up to snuff zijn, maar check zeker even.

@jurb jurb reopened this Oct 9, 2025
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.

3 participants