Closed SantoshSrinivas79 closed 2 months ago
Hi @SantoshSrinivas79 !
Hi @chinchang, Here you go sir. The only thing I did is update, src/firebaseInit.js
with my details and did a gulp release
. I am serving the app using nginx
from the dist
folder.
I added all logs in the video below. I enabled window.DEBUG
by hardcoding to ensure logging. I tried a bit of debugging and see that calls to firestore are working but the data is not getting rendered in the UI.
https://github.com/chinchang/web-maker/assets/1036163/42f88ac2-ae2c-4cfc-8191-741c257835e5
On glancing through the code, I see that the UI elements are getting rendered from information in the state.
The issue was related to the Firebase error you see in your video about not being able to update the user document. Actual Web maker creates a user document for every one behind the scenes. Since you have your own DB (without the cloud functions), you didn't have the user document for your user. Now the specific reason why the items were not fetched was because the fetching was somehow tied to reading the user document. It was not required really and I have fixed it now. If you get the latest master and run that, it should be working!
Let me know if it doesn't.
Thanks a ton. Works great @chinchang !
Just a tiny point ... I think the user doc fix can be made for this section too:
My saved items are showing up correctly! Thanks a ton! :)
One small help, can you please document the exact firestore privacy rules? I made them too generic in my install :)
Hey @SantoshSrinivas79 I think for a private self-hosted app, these rules should be enough:
service cloud.firestore {
match /databases/{database}/documents {
function isAuthenticatedCreation() {
return request.auth.uid == request.resource.data.createdBy;
}
function isAuthenticatedUpdation() {
return request.auth.uid == resource.data.createdBy;
}
match /items/{itemId} {
allow create: if isAuthenticatedCreation();
allow update: if isAuthenticatedUpdation();
allow read: if request.auth.uid == resource.data.createdBy;
}
match /{document=**} {
allow read, write: if false;
}
}
}
@chinchang Thank you sir
Meta info
After installing and building a release and self-hosting, below are few that seem to not work on:
Anonymous Creator
My Library
shows zero entriesI tried debugging a bit and looks like there is problem state management in the
master
branch. Pls advise.