Skip to content

אפשרות שיתוף עם כתובת מייל שעדיין לא נרשמה - #5

Merged
Star69995 merged 1 commit into
mainfrom
claude/add-emails-before-signup-g7tcr4
Sep 30, 2026
Merged

Star69995 merged 1 commit into
mainfrom
claude/add-emails-before-signup-g7tcr4

Conversation

@Star69995

Copy link
Copy Markdown
Owner

Summary

  • מקבל שירות שמנסה לשתף לפי כתובת מייל שעוד אין לה חשבון לא נכשל יותר — נשמרת "הזמנה ממתינה" ב-users/{recipientUid}/pendingShares/{email} (אותו מבנה scope/planIds/permission כמו שיתוף רגיל), ניתנת לעריכה/ביטול דרך אותם TrashSection/ConfirmDialog משותפים, במקטע חדש "הזמנות ממתינות להרשמה" ב-Providers.jsx.
  • ברגע שמישהו נרשם ומאמת בדיוק את אותה כתובת מייל כנותן שירות, claimPendingSharesForEmail (רץ בכל טעינת session לצד ensureEmailIndex) הופך את ההזמנה לשיתוף אמיתי בעצמו (batch אטומי: יצירת shares/{providerUid} + מחיקת ה-pending doc) — בלי צורך בפעולה נוספת מהמקבל.
  • firestore.rules מתעדכן כך שספק יכול ליצור את מסמך השיתוף של עצמו רק כשקיימת הזמנה תואמת ותפקידו provider — כדי שאף אחד לא יוכל להעניק לעצמו גישה בלי הזמנה אמיתית שממתינה לו.

Test plan

  • npm run verify:rules הורץ מול האמולטור המקומי (Auth+Firestore) — 75/75 תרחישים עברו, כולל תרחישים חדשים: יצירת הזמנה, דחיית mismatch בין email ל-doc ID, חסימת collection-group query למי שאין לו מייל תואם, מניעת "הענקת גישה לעצמי" ללא הזמנה, זרימת ה-claim המלאה, מניעת claim חוזר, ומחזור החיים של מחיקה רכה/שחזור/מחיקה קשה להזמנה.
  • npm run lint — אין שגיאות חדשות (4 השגיאות הקיימות לא קשורות לשינוי זה, אומתו מול git stash).
  • npm run build — עובר בהצלחה.
  • CLAUDE.md ו-README.md עודכנו לשקף את המודל החדש.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ab9ezHouQPa5iE3eHUgaXW


Generated by Claude Code

Recipients can now invite a provider by email before they have an
account. When resolveEmailToUser finds nobody, Providers.jsx saves a
"pending share" invite instead of failing, keyed by the lowercased
email at users/{recipientUid}/pendingShares/{email}. The invite is
editable and cancelable (soft-delete/trash) like any other share.

Once someone registers and verifies that exact email as a provider
account, claimPendingSharesForEmail (run alongside ensureEmailIndex on
every session) finds the matching invite via a collection-group query
and converts it into a real share themselves, atomically deleting the
pending doc. firestore.rules gates this self-claim on a matching
pendingShares doc actually existing for that recipient/email and the
claimer's role being 'provider', so nobody can grant themselves access
without a genuine invite waiting for them.

All rule changes verified against the local Firestore emulator via
scripts/verify-firestore-rules.mjs, which gained scenarios for invite
creation, the email-mismatch/ownership checks, the claim flow itself,
re-claim prevention, and the soft-delete/trash lifecycle.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ab9ezHouQPa5iE3eHUgaXW
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 3d459ff):

https://beyond-borders-23adb--pr5-claude-add-emails-be-g1xz42lt.web.app

(expires Wed, 07 Oct 2026 09:06:14 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9709cd9c990d1253817c14439af81df88b94457c

@Star69995
Star69995 merged commit a4b8e65 into main Sep 30, 2026
2 checks passed
@Star69995
Star69995 deleted the claude/add-emails-before-signup-g7tcr4 branch September 30, 2026 09:43
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