fix: sql function get_mining_source_credentials_for_user#2850
Merged
Conversation
Add config JSONB column to private.mining_sources for per-source settings. Backend supports miningSource.id lookup with fallback to email. Edge functions read config flags and pass them through the pipeline. Frontend adds toggles in PassiveMiningDialog and sources.vue. i18n labels in en/fr. Partially resolves #2818
- Remove spurious async on PgMiningSources.getSourceById stub (DeepSource JS-0116) - Update startMiningSchema to accept miningSource.id as optional alternative to email - Wire Zod validate() middleware into all mining routes - Install hpp middleware for HTTP Parameter Pollution defense - Guard req.query.userId against array pollution in auth middleware
- Run prettier on mining.schema.ts (was failing CI check) - Add express-rate-limit to mining POST routes (CodeQL flagged db-access without rate limiting)
Coverage Report✅ Passed Commit: d52ba0b Summary
All files
No coverage changes
Generated by Test Coverage Reporter for commit d52ba0b |
…aboot-source/leadminer into google-contact-sync-advanced
This reverts commit 19f5b8a.
When a contact has telephone: [] instead of telephone: null, the NOT_EMPTY filter incorrectly shows the contact as having a phone number. The contacts_view database view returns empty arrays instead of null for contacts without phone numbers. Added Array.isArray(value) && value.length === 0 check to treat empty arrays as empty.
Closing modal before the API call left users with no feedback while deletion was in progress. Now the modal stays open (with loading state) during the request and closes only on success.
…low processing when stepper is initialized
Collaborator
Author
|
Ready for review. This PR now includes: delete-user fix:
Passive mining toggle fix:
Local dev edge function fixes:
Other frontend fixes in this PR:
|
…used ts-expect-error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2850 and fixes 6 bugs discovered during QA demo + 2 follow-up bugs from continued testing.
Summary
DB Migration
supabase/migrations/20260619000000_delete_user_data_auth_uid.sql— newprivate.delete_user_data()function (parameterless,SECURITY DEFINER, usesauth.uid()) that delegates contact cleanup toprivate.delete_contacts(NULL, TRUE)and cleans all other user-owned tables. Preservesprivate.email_statusas a shared enrichment cache.Edge Function
supabase/functions/delete-user/index.ts— now callsdelete_user_data()via the authenticated user client (not admin) and keeps admin only forauth.admin.deleteUser().supabase/functions/_shared/mailing/email.ts— guardssendEmailwhen SMTP is not configured (local dev).supabase/functions/email-campaigns/deno.lockremoved — local Supabase Edge Runtime doesn't support lockfile v5.Frontend Fixes
PassiveMiningDialog.vue— uses store refs for defaults, guards watcher witholdValto prevent overwriting user toggle changes.ContactInformationSidebar.vue—toRaw(contact.value)before passing to cache, safety guards inskipDialog/allTags/watch(show).stores/contacts.ts—JSON.parse(JSON.stringify(...))deep-clone inupdateContactsCache, try/catch insyncContactsListand realtime callback.stores/filters.ts+filters-defaults.ts— newemailMissingtoggle filter for "phone without email" contacts.MiningTable.vue— new ToggleSwitch for the email-missing filter with i18n.Test plan
deno testfor delete-user edge function (5 tests pass)Out of scope (handled separately)
Proxy object could not be clonedloop (mitigated with JSON deep-clone)