Commit 51a5d5c5 authored by Adam Štěpánek's avatar Adam Štěpánek
Browse files

Merge branch 'dev' into 'main'

Fix a severe event desync problem in perms

See merge request !84
parents c6f5270f 186a6dfa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ public class AuthorService
            db.Events.Append(created.AuthorId, infoChanged);
        }

        await db.SaveChangesAsync(token);

        if (ownerId is not null)
        {
            await accountService.AddPermissions(
@@ -77,8 +79,6 @@ public class AuthorService
                token);
        }

        await db.SaveChangesAsync(token);

        // NB: perform a live aggregation because the DB might still have outdated data
        return await db.Events.AggregateStreamAsync<AuthorInfo>(created.AuthorId, token: token)
            ?? throw new InvalidOperationException($"Could not persist an author with id '{created.AuthorId}'.");
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ services:
      - kafe_temp:/mnt/kafe_temp
    depends_on:
      - db
    command: ["bash", "-c", "/app/Kafe.Api projections --rebuild && /app/Kafe.Api"]
    command: ["bash", "-c", "/app/Kafe.Api projections --rebuild --shard-timeout 30m && /app/Kafe.Api"]
    networks:
      default:
        aliases: