Skip to content

Necessary speed improvements#758

Merged
CalJosKos merged 5 commits intomainfrom
dev
Feb 17, 2026
Merged

Necessary speed improvements#758
CalJosKos merged 5 commits intomainfrom
dev

Conversation

@CalJosKos
Copy link
Collaborator

Root cause fix (eliminated double-mounting):

  • app/terms.tsx — router.navigate('/') → router.replace('/')
  • components/App.tsx — router.navigate('/terms') → router.replace('/terms')
    LocalizationProvider refactor (reduced PowerSync listener count):
  • hooks/useLocalization.tsx — Renamed from .ts, added LocalizationProvider context so only one PowerSync query runs for localization instead of one per component
  • app/_layout.tsx — Wrapped app tree in
    RecordingView performance fixes:
  • views/new/RecordingView.tsx — Replaced reactive PowerSync queries with static useQuery + staleTime: Infinity for project and languoid data; added mountedRef guard against post-unmount state updates; smarter VAD invalidation (only on actual active→inactive transitions); tracked error timeouts for proper cleanup
    Reduced cascade invalidations:
  • hooks/useQuestDownloadStatusLive.ts — Only invalidate queries on actual download status transitions detected by the watch, not on initial mount check
    Memory leak prevention:
  • hooks/useMicrophoneEnergy.ts — removeAllListeners cleanup for native event emitters
  • views/new/recording/hooks/useVADRecording.ts — Stop energy detection on unmount; removeAllListeners cleanup

* init speed improvements attempt

Root cause fix (eliminated double-mounting):
- app/terms.tsx — router.navigate('/') → router.replace('/')
- components/App.tsx — router.navigate('/terms') → router.replace('/terms')
LocalizationProvider refactor (reduced PowerSync listener count):
- hooks/useLocalization.tsx — Renamed from .ts, added LocalizationProvider context so only one PowerSync query runs for localization instead of one per component
- app/_layout.tsx — Wrapped app tree in <LocalizationProvider>
RecordingView performance fixes:
- views/new/RecordingView.tsx — Replaced reactive PowerSync queries with static useQuery + staleTime: Infinity for project and languoid data; added mountedRef guard against post-unmount state updates; smarter VAD invalidation (only on actual active→inactive transitions); tracked error timeouts for proper cleanup
Reduced cascade invalidations:
- hooks/useQuestDownloadStatusLive.ts — Only invalidate queries on actual download status transitions detected by the watch, not on initial mount check
Memory leak prevention:
- hooks/useMicrophoneEnergy.ts — removeAllListeners cleanup for native event emitters
- views/new/recording/hooks/useVADRecording.ts — Stop energy detection on unmount; removeAllListeners cleanup

* Update RecordingView.tsx

- Ensure new recordings show up after old session bulk deleted
- Remove verse insertion option for a recording session if not selected after firost recording is done

* Format fix

* Fix format again
@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
langquest Ready Ready Preview, Comment Feb 17, 2026 9:42pm

Request Review

@supabase
Copy link

supabase bot commented Feb 17, 2026

This pull request has been ignored for the connected project unsxkmlcyxgtgmtzfonb because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@CalJosKos
Copy link
Collaborator Author

@rafaelwinter01 reintroduced toCompilableQuery to use cloudQuery in RecordingView.tsx so that it can find the languoid for a user invited to a project. Currently there's no trigger to have languoids, project_language_link records sync to a user if that user is added to a project (unless they download a quest, which they don't strictly have to to make new quests in the project).
TODO: Install trigger to have new members of a project sync languoid/region-related records and project_language_link record to their device.

… project (#760)

Add DB trigger on profile_project_link INSERT/UPDATE that cascades the new member's profile ID to project, project_language_link, project_closure, languoid, and all 8 related languoid/region tables
Fix perform_clone_step to include creator's ID in download_profiles on cloned project and PLL records
Backfill existing active project members into all affected download_profiles fields
Block invite/request acceptance while offline (requires sync to receive languoid data)
Add mustBeOnlineToAcceptInvite localization string (6 languages)
@CalJosKos
Copy link
Collaborator Author

Resolved an additional issue where languoids (and related records inc. project_language_link) were not syncing to user accounts who were invited into a project until they actively downloaded a quest.

Before, if a user was brought into an existing project (whose target language was not a ui_ready language), and they went offline, without having downloaded a quest, and tried to record content, they weren't able to. This is fixed now, and missing download_profiles data is backfilled in 20260217120000...sql

@CalJosKos
Copy link
Collaborator Author

Tested:

  • Reordering pre-published acl content and publishing (order preserved)
  • Reordering published acl content and publishing (order preserved)
  • Recording content while offline in a project joined via invitation (without having downloaded any quests) (success)

@CalJosKos CalJosKos merged commit b1993aa into main Feb 17, 2026
35 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.

3 participants

Comments