You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useFirestoreDocData returns status: "success" for wrong document #327
Include the TestBug component somewhere in your view hierarchy and change the DOCUMENT_IDS and "images" to actual documents in your instance. Check the console log for output.
Expected behavior
useFirestoreDocData will return status: "success" only when data is populated with the doc ref passed in.
Actual behavior
In this case, useFirestoreDocData returns status: "success" with the data field populated with the previous document requested. You can see this from the console log of:
TestBug.js:18 id to load lyDiZdJoItgaHLVM4f2g
TestBug.js:19 loaded doc loading undefined
// loading the first doc
TestBug.js:18 id to load lyDiZdJoItgaHLVM4f2g
TestBug.js:19 loaded doc success lyDiZdJoItgaHLVM4f2g
// loaded first doc, the requested document and returned document are the same
TestBug.js:18 id to load dE4u1v30VSd84u9LQgaR
TestBug.js:19 loaded doc success lyDiZdJoItgaHLVM4f2g
// loading the second doc but it still returns the first document. the requested document and returned document are not the same!
TestBug.js:18 id to load dE4u1v30VSd84u9LQgaR
TestBug.js:19 loaded doc success dE4u1v30VSd84u9LQgaR
// finally, the second doc has loaded and now the requested document and returned document are the same
Activity