Repository navigation
אפשרות שיתוף עם כתובת מייל שעדיין לא נרשמה - #5
Merged
Merged
Conversation
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
|
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 |
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.
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