Skip to content

Conversation

@krida2000
Copy link
Contributor

@krida2000 krida2000 commented May 10, 2024

Resolves #444

Synopsis

Если быстро менять какой-либо статус, будет происходить гонка событий, из-за чего статус может на несколько фреймов отображаться некоректно.

Solution

Проблема будет исправлена.

Checklist

  • Created PR:
    • In draft mode
    • Name contains issue reference
    • Has type and k:: labels applied
  • Before review:
    • Documentation is updated (if required)
    • Tests are updated (if required)
    • Changes conform code style
    • CHANGELOG entry is added (if required)
    • FCM (final commit message) is posted or updated
    • Draft mode is removed
  • Review is completed and changes are approved
    • FCM (final commit message) is approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • All temporary labels are removed

@krida2000 krida2000 added enhancement Improvement of existing features or bugfix k::UI/UX UI (user interface) and UX (user experience) changes k::refactor Refactor changes of existing code labels May 10, 2024
@krida2000 krida2000 added this to the 0.1.0-alpha.14 milestone May 10, 2024
@krida2000 krida2000 self-assigned this May 10, 2024
@krida2000 krida2000 changed the title Events race on frequently sending requests Events race on frequently sending requests (#444) May 10, 2024
@krida2000
Copy link
Contributor Author

krida2000 commented May 13, 2024

FCM

Refactor `ChatRepository` and `ContactRepository` to use `EventPool` (#994, #444)

Additionally:
- disable block button when user being blocked or unblocked

Comment on lines -1521 to +1528
Future<void> _chatEvent(ChatEvents event) async {
Future<void> chatEvent(
ChatEvents event, {
bool updateVersion = true,
}) async {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SleepySquash Не стал пока двигать этот метод наверх, так как будет очень большой diff, и не будет понятно что вообще тут поменялось.

Comment on lines +544 to +552

@override
bool operator ==(Object other) =>
other is EventChatUnfavorited &&
chatId == other.chatId &&
kind == other.kind;

@override
int get hashCode => Object.hash(chatId, kind);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SleepySquash Когда мы добавляли EventPool для MyUserRepository то писали operator == для всех ивентов. Тут я не уверен что так нужно поступать, так как нам нужно уметь сравнивать не так много ивентов, а писать operator == которые не будут использоваться еще для 20+ ивентов не вижу смысла.

@krida2000 krida2000 requested a review from SleepySquash May 13, 2024 12:44
@krida2000 krida2000 marked this pull request as ready for review May 13, 2024 12:44
@SleepySquash SleepySquash modified the milestones: 0.1.0, 0.2.0, 0.1.3 Jun 27, 2024
@SleepySquash SleepySquash removed this from the 0.1.4 milestone Jul 10, 2024
@SleepySquash SleepySquash modified the milestones: 0.6.4, 0.7.0, 0.6.5 Sep 29, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.6, 0.7.0 Oct 13, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.7, 0.7.0, 0.6.8 Oct 29, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.9, 0.7.0, 0.6.10 Nov 11, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.11, 0.7.0 Nov 24, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.12, 0.7.0 Dec 1, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.13, 0.7.0 Dec 8, 2025
@SleepySquash SleepySquash modified the milestones: 0.6.14, 0.7.0, 0.8.0 Dec 19, 2025
@SleepySquash SleepySquash modified the milestones: 0.7.1, 0.8.0, 0.7.2 Jan 7, 2026
@SleepySquash SleepySquash modified the milestones: 0.8.0, 0.9.0 Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of existing features or bugfix k::refactor Refactor changes of existing code k::UI/UX UI (user interface) and UX (user experience) changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Events race on frequently sending requests

3 participants