useFirestoreDocData & useFirestoreDoc won't throw a promise on permission denied
Maintainer antworten meist innerhalb von 2 Tagen
@jhuleatt arbeitet bereits daran.
Seit 10.12.2019.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Version info
React: 16.12.0
Firebase: 7.5.2
ReactFire: 2.0.0-canary.1fce6b9
Test case
I want to use role based authentication on documents, so when a document is successfully read in the app and then I change the access of that user, the listener throws an error instead of a Promise.
const CompanyCheck: React.FC = ({ children }) => {
const { companyId, setCompany } = useCompanyContext();
const firestore: Firebase['Firestore'] = useFirestore();
const companyRef = useRef(
firestore()
.collection('companies')
.doc(companyId)
);
useEffect(() => {
companyRef.current = firestore()
.collection('companies')
.doc(companyId);
}, [companyId, firestore]);
// This won't throw a promise on permission changes after successfull read.
const companyDoc = useFirestoreDocData<Company>(companyRef.current);
useEffect(() => {
setCompany(companyDoc);
}, [companyDoc, setCompany]);
return <>{children}</>;
};
Steps to reproduce
Use a correct example of read operation with role access, then once the data is displayed remove the access to the document and error boundary won't catch any error.
Expected behavior
Throw a promise like when initial read fails so ErrorBoundary can catch the error.
Actual behavior
Don't throw a Promise and error can't be handled. Error message is: 'permission-denied'
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.6k
- Forks
- 403
- Ø Merge
- 4 T. 19 Std.
- Gemergte PRs (30 T.)
- 11
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus FirebaseExtended/reactfire
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
FirebaseExtended/reactfire#801 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
v5
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
FirebaseExtended/reactfire#793 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
v5
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
FirebaseExtended/reactfire#790 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
v5
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
FirebaseExtended/reactfire#789 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
FirebaseExtended/reactfire#788 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in FirebaseExtended/reactfire
Ähnliche Issues
-
area/frontend good first issue kind/cooldown
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
voidzero-dev/oxc-angular-compiler#511 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
langchain-ai/deepagentsjs#898 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
anomalyco/models.dev#8509 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug documentation P2 UI/UX
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag