@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sync.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubling/compound-sync",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Bidirectional sync between Compound and local markdown files",
5
5
  "type": "module",
6
6
  "bin": {
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
- const sharedQ = query(filesRef, where('sharedWith', 'array-contains', USER_ID));
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();