Skip to content

Commit

Permalink
#1503 dupicates on upsync: better handling of lost ACLs -> remove mis…
Browse files Browse the repository at this point in the history
…sing users from cards
  • Loading branch information
desperateCoder committed Nov 21, 2024
1 parent 7568a20 commit 4343dd8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ public void deleteJoinedUserForCardPhysically(long localCardId, long localUserId
db.getJoinCardWithUserDao().deleteByCardIdAndUserIdPhysically(localCardId, localUserId);
}

public void deleteJoinedUsersForCardsInBoardPhysically(long localBoardId) {
db.getJoinCardWithUserDao().deleteJoinedUsersForCardsInBoardPhysically(localBoardId);
public void deleteJoinedUsersForCardsInBoardWithoutPermissionPhysically(long localBoardId) {
db.getJoinCardWithUserDao().deleteJoinedUsersForCardsInBoardWithoutPermissionPhysically(localBoardId);
}

public void createJoinCardWithUser(long localUserId, long localCardId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface JoinCardWithUserDao extends GenericDao<JoinCardWithUser> {
@Query("DELETE FROM joincardwithuser " +
"WHERE cardid in (select c.localId from Card c join Stack s on c.stackId = s.localId and s.boardId = :localBoardId) " +
"and userId not in (select userId from UserInBoard where boardId = :localBoardId)")
void deleteJoinedUsersForCardsInBoardPhysically(long localBoardId);
void deleteJoinedUsersForCardsInBoardWithoutPermissionPhysically(long localBoardId);

@Query("select * FROM joincardwithuser WHERE cardId = :localCardId and userId = :localUserId")
JoinCardWithUser getJoin(Long localUserId, Long localCardId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void handleUsers(DataBaseAdapter dataBaseAdapter, long accountId, FullBo
dataBaseAdapter.addUserToBoard(existing.getLocalId(), entity.getLocalId());
}
}
dataBaseAdapter.deleteJoinedUsersForCardsInBoardPhysically(entity.getLocalId());
dataBaseAdapter.deleteJoinedUsersForCardsInBoardWithoutPermissionPhysically(entity.getLocalId());
}

private User createOrUpdateUser(DataBaseAdapter dataBaseAdapter, long accountId, User remoteUser) {
Expand Down

0 comments on commit 4343dd8

Please sign in to comment.