Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chat): Fix infinite loading spinner when someone cleared the history #13925

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Service/ParticipantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Member;
use OCA\Talk\CachePrefix;
use OCA\Talk\Chat\ChatManager;
use OCA\Talk\Config;
use OCA\Talk\Events\AAttendeeRemovedEvent;
use OCA\Talk\Events\AParticipantModifiedEvent;
Expand Down Expand Up @@ -1409,7 +1410,7 @@ public function markUsersAsMentioned(Room $room, string $actorType, array $actor
public function resetChatDetails(Room $room): void {
$update = $this->connection->getQueryBuilder();
$update->update('talk_attendees')
->set('last_read_message', $update->createNamedParameter(0, IQueryBuilder::PARAM_INT))
->set('last_read_message', $update->createNamedParameter(ChatManager::UNREAD_FIRST_MESSAGE, IQueryBuilder::PARAM_INT))
->set('last_mention_message', $update->createNamedParameter(0, IQueryBuilder::PARAM_INT))
->set('last_mention_direct', $update->createNamedParameter(0, IQueryBuilder::PARAM_INT))
->set('last_attendee_activity', $update->createNamedParameter($this->timeFactory->getTime(), IQueryBuilder::PARAM_INT))
Expand Down
12 changes: 12 additions & 0 deletions tests/integration/features/chat-1/delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,19 @@ Feature: chat/delete
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room1 | users | participant2 | participant2-displayname | Message 2 | [] |
| room1 | users | participant1 | participant1-displayname | Message 1 | [] |
Then user "participant1" is participant of room "room1" (v4)
| unreadMessages | lastReadMessage |
| 1 | Message 1 |
Then user "participant2" is participant of room "room1" (v4)
| unreadMessages | lastReadMessage |
| 0 | Message 2 |
And user "participant1" deletes chat history for room "room1" with 200
Then user "participant1" is participant of room "room1" (v4)
| unreadMessages | lastReadMessage |
| 1 | FIRST_MESSAGE_UNREAD |
Then user "participant2" is participant of room "room1" (v4)
| unreadMessages | lastReadMessage |
| 1 | FIRST_MESSAGE_UNREAD |
Then user "participant1" sees the following messages in room "room1" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
Then user "participant1" sees the following system messages in room "room1" with 200 (v1)
Expand Down
Loading