diff --git a/packages/app-desktop/runForTesting.sh b/packages/app-desktop/runForTesting.sh index 96ae4d589..106d04726 100755 --- a/packages/app-desktop/runForTesting.sh +++ b/packages/app-desktop/runForTesting.sh @@ -10,6 +10,12 @@ # ./runForTesting.sh 1 createUsers,createData,reset,e2ee,sync && ./runForTesting.sh 2 reset,e2ee,sync && ./runForTesting.sh 1 +# ---------------------------------------------------------------------------------- +# First user has E2EE, but second one doesn't: +# ---------------------------------------------------------------------------------- + +# ./runForTesting.sh 1 createUsers,createData,reset,e2ee,sync && ./runForTesting.sh 2 reset,sync && ./runForTesting.sh 1 + # ---------------------------------------------------------------------------------- # Without E2EE: # ---------------------------------------------------------------------------------- diff --git a/packages/server/src/routes/api/users.ts b/packages/server/src/routes/api/users.ts index 53adcac25..1c48490ac 100644 --- a/packages/server/src/routes/api/users.ts +++ b/packages/server/src/routes/api/users.ts @@ -34,6 +34,7 @@ router.get('api/users/:id/public_key', async (path: SubPath, ctx: AppContext) => if (!user) return ''; // Don't throw an error to prevent polling the end point const ppk = await ctx.joplin.models.user().publicPrivateKey(user.id); + if (!ppk) return ''; return { id: ppk.id,