Skip to content

Feat/profile editor performance improvements#942

Merged
coodos merged 16 commits intomainfrom
feat/profile-editor-performance-improvements
Apr 3, 2026
Merged

Feat/profile editor performance improvements#942
coodos merged 16 commits intomainfrom
feat/profile-editor-performance-improvements

Conversation

@coodos
Copy link
Copy Markdown
Contributor

@coodos coodos commented Apr 3, 2026

Description of change

improve performance on profile editor

Issue Number

Type of change

  • Update (a change which updates existing functionality)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ability to browse public profiles without search queries
    • Added inline previews for CV (PDF viewer) and video introduction in profiles
    • Added admin profile viewing via URL parameter
  • Improvements

    • Enhanced search with debouncing for better performance
    • Implemented optimistic UI updates for privacy toggle
    • Improved profile field display—empty fields no longer render
    • Better file preview/download handling with automatic fallback
    • Refined profile card layout and spacing
  • Bug Fixes

    • Fixed conditional rendering in education and experience sections to hide empty entries

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae7fc594-e8d6-41f3-928e-d3e63f6cd363

📥 Commits

Reviewing files that changed from the base of the PR and between 9a3a214 and 557e803.

📒 Files selected for processing (23)
  • infrastructure/evault-core/src/core/db/db.service.ts
  • infrastructure/evault-core/src/core/protocol/graphql-server.ts
  • platforms/profile-editor/api/src/controllers/DiscoveryController.ts
  • platforms/profile-editor/api/src/controllers/ProfileController.ts
  • platforms/profile-editor/api/src/controllers/WebhookController.ts
  • platforms/profile-editor/api/src/index.ts
  • platforms/profile-editor/api/src/services/EVaultProfileService.ts
  • platforms/profile-editor/api/src/services/EVaultSyncService.ts
  • platforms/profile-editor/api/src/services/RegistryService.ts
  • platforms/profile-editor/api/src/services/UserSearchService.ts
  • platforms/profile-editor/api/src/utils/file-proxy.ts
  • platforms/profile-editor/api/src/web3adapter/watchers/subscriber.ts
  • platforms/profile-editor/client/src/lib/components/profile/DocumentsSection.svelte
  • platforms/profile-editor/client/src/lib/components/profile/EducationSection.svelte
  • platforms/profile-editor/client/src/lib/components/profile/ExperienceSection.svelte
  • platforms/profile-editor/client/src/lib/components/profile/ProfileCard.svelte
  • platforms/profile-editor/client/src/lib/components/profile/ProfileHeader.svelte
  • platforms/profile-editor/client/src/lib/stores/discovery.ts
  • platforms/profile-editor/client/src/lib/stores/profile.ts
  • platforms/profile-editor/client/src/lib/utils/file-manager.ts
  • platforms/profile-editor/client/src/routes/(protected)/discover/+page.svelte
  • platforms/profile-editor/client/src/routes/(protected)/profile/+page.svelte
  • platforms/profile-editor/client/src/routes/(protected)/settings/+page.svelte

📝 Walkthrough

Walkthrough

This PR introduces optimistic profile updates with background persistence, deduplicates overlapping envelope metadata, caches profile/registry data with TTL-based invalidation, refactors file proxy handling, enhances the discovery interface with public profile browsing, and adds admin impersonation and conditional asset preview/rendering across API and client.

Changes

Cohort / File(s) Summary
eVault Core Database & GraphQL
infrastructure/evault-core/src/core/db/db.service.ts, infrastructure/evault-core/src/core/protocol/graphql-server.ts
updateMetaEnvelopeById now deduplicates envelopes sharing the same ontology, switches from CREATE to MERGE for relationship construction with ON CREATE/MATCH SET logic, and logs duplicate counts. GraphQL responses for createMetaEnvelope and updateMetaEnvelope now populate parsed field from result envelopes rather than echoing input payload.
Profile API Controllers
platforms/profile-editor/api/src/controllers/DiscoveryController.ts, platforms/profile-editor/api/src/controllers/ProfileController.ts, platforms/profile-editor/api/src/controllers/WebhookController.ts, platforms/profile-editor/api/src/index.ts
Discovery endpoint now conditionally searches or lists public profiles based on query presence; default limit changed to 12. ProfileController adds sync service integration, resolves ename override via query parameter, replaces direct upsert with optimistic updates, refactors asset authorization, and wires sync service during initialization. WebhookController adds diagnostic logging.
Profile API Caching & Persistence Services
platforms/profile-editor/api/src/services/EVaultProfileService.ts, platforms/profile-editor/api/src/services/RegistryService.ts, platforms/profile-editor/api/src/services/UserSearchService.ts
EVaultProfileService introduces per-user caching with TTL, write queueing for serialization, and replaces upsertProfile with prepareUpdate returning a PreparedWrite with immediate cache update and deferred persistence. RegistryService caches resolveEName results (10-min TTL). UserSearchService adds listPublicUsers method for public profile discovery.
Profile API Search Sync & File Proxy
platforms/profile-editor/api/src/services/EVaultSyncService.ts, platforms/profile-editor/api/src/utils/file-proxy.ts, platforms/profile-editor/api/src/web3adapter/watchers/subscriber.ts
EVaultSyncService introduces syncUserToSearchDb to sync cached profiles asynchronously. File proxy replaces mode parameter with disposition, always attempts preview endpoint first, overrides cache headers to no-cache, and derives filenames from upstream headers. Subscriber adds table-change debug logging.
Profile Client Components
platforms/profile-editor/client/src/lib/components/profile/DocumentsSection.svelte, platforms/profile-editor/client/src/lib/components/profile/EducationSection.svelte, platforms/profile-editor/client/src/lib/components/profile/ExperienceSection.svelte, platforms/profile-editor/client/src/lib/components/profile/ProfileCard.svelte, platforms/profile-editor/client/src/lib/components/profile/ProfileHeader.svelte
Components add conditional rendering for empty fields (Education, Experience), preview UI for CV/video assets (Documents), centered avatar/card layout with multi-line headline clamping (ProfileCard), and local object URL previews for avatar/banner uploads with error state handling (ProfileHeader).
Profile Client Stores & Utils
platforms/profile-editor/client/src/lib/stores/discovery.ts, platforms/profile-editor/client/src/lib/stores/profile.ts, platforms/profile-editor/client/src/lib/utils/file-manager.ts, platforms/profile-editor/client/src/routes/(protected)/discover/+page.svelte, platforms/profile-editor/client/src/routes/(protected)/profile/+page.svelte, platforms/profile-editor/client/src/routes/(protected)/settings/+page.svelte
Discovery store conditionally includes q parameter. Profile store adds admin impersonation override accessors and appends query suffix to all profile mutations. File manager removes explicit Content-Type header for multipart uploads. Discover route adds debounced search, initial public profile load, and empty-state UI. Profile route reads as query parameter for admin override. Settings page performs optimistic UI update for public profile toggle with revert on failure.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • feat: idiomatic graphql api #769 — Directly modifies the same db.service.ts meta-envelope update logic and graphql-server.ts response construction that this PR refactors for deduplication and parsed-field population.

Suggested reviewers

  • sosweetham
  • ananyayaya129

Poem

🐰 Caches bloom and queues align,
Envelopes dedupe so fine!
Profiles preview, searched with care,
Async magic floats through air—
One hop closer, crystal clear! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/profile-editor-performance-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coodos coodos marked this pull request as ready for review April 3, 2026 09:48
@coodos coodos merged commit 2416ed1 into main Apr 3, 2026
5 of 6 checks passed
@coodos coodos deleted the feat/profile-editor-performance-improvements branch April 3, 2026 09:48
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.

1 participant