Skip to content

Commit 1aeefd3

Browse files
committed
Fix problem with party edits
Since party.users is mapped to set in Android, it may be converted to array with different order when saving to Firestore.
1 parent fecf398 commit 1aeefd3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

firebase/firestore.rules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,10 @@ service cloud.firestore {
311311
let party = request.resource.data;
312312
let diff = resource.data.diff(request.resource.data);
313313

314-
return ["ambitions", "name", "archived", "time"].toSet().hasAll(diff.affectedKeys())
314+
return ["ambitions", "name", "archived", "time", "users"].toSet().hasAll(diff.affectedKeys())
315315
&& areAmbitionsValid(party.ambitions)
316316
&& isValidPartyName(party.name)
317+
&& party.users.toSet() == resource.data.users.toSet()
317318
&& (! ("time" in party) || isValidImperialTime(party.time))
318319
&& (! ("archived" in party) || party.archived is bool)
319320
}

0 commit comments

Comments
 (0)