@doubling/compound-sync 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sync.js +9 -1
package/package.json
CHANGED
package/sync.js
CHANGED
|
@@ -833,7 +833,15 @@ async function setupOrgSync({ orgId, localPath: rawLocalPath }) {
|
|
|
833
833
|
}, err => console.error(` [${orgId}] Private files listener error:`, err));
|
|
834
834
|
console.log(` [${orgId}] Listening: Private files + Shared by Me symlinks`);
|
|
835
835
|
|
|
836
|
-
|
|
836
|
+
// scope=='private' is required: Firestore rules only grant
|
|
837
|
+
// sharedWith-based reads on private files, so the query must
|
|
838
|
+
// constrain scope or the whole listen is denied (rules are not
|
|
839
|
+
// filters). See tests/rules.test.js "shared-with-me query".
|
|
840
|
+
const sharedQ = query(
|
|
841
|
+
filesRef,
|
|
842
|
+
where('scope', '==', 'private'),
|
|
843
|
+
where('sharedWith', 'array-contains', USER_ID),
|
|
844
|
+
);
|
|
837
845
|
onSnapshot(sharedQ, snapshot => {
|
|
838
846
|
snapshot.docChanges().forEach(change => {
|
|
839
847
|
const data = change.doc.data();
|