diff --git a/feature/metis/conversation/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/conversation/service/storage/impl/MetisStorageServiceImpl.kt b/feature/metis/conversation/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/conversation/service/storage/impl/MetisStorageServiceImpl.kt index 5e46e455e..da80b42be 100644 --- a/feature/metis/conversation/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/conversation/service/storage/impl/MetisStorageServiceImpl.kt +++ b/feature/metis/conversation/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/conversation/service/storage/impl/MetisStorageServiceImpl.kt @@ -513,7 +513,7 @@ internal class MetisStorageServiceImpl( ) insertOrUpdateAnswerPost( - isNewPost = queryClientPostIdAnswer != null, + isNewPost = queryClientPostIdAnswer == null, answerPostClientSidePostId = queryClientPostIdAnswer ?: UUID.randomUUID() .toString(), answerPost = ap, diff --git a/feature/metis/shared/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/shared/db/MetisDao.kt b/feature/metis/shared/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/shared/db/MetisDao.kt index 129ae15ca..73207808a 100644 --- a/feature/metis/shared/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/shared/db/MetisDao.kt +++ b/feature/metis/shared/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/metis/shared/db/MetisDao.kt @@ -15,7 +15,6 @@ import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.db.entiti import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.db.entities.PostReactionEntity import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.db.entities.StandalonePostTagEntity import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.db.entities.StandalonePostingEntity -import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.db.pojo.AnswerPostPojo import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.db.pojo.PostPojo import kotlinx.coroutines.flow.Flow import kotlinx.datetime.Instant @@ -34,7 +33,8 @@ interface MetisDao { suspend fun clearAll(serverId: String) /** - * Query the client side post if for the given metis context. Returns null if the given post is not yet stored. + * Query the client side post id for the given server side post id. + * Returns null if the given post is not yet stored. * Note: Standalone posts and answer posts may have the same ids. */ @Query(