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

Events race on frequently sending requests (#444) #994

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

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 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 added this to the 0.2.0 milestone Jul 10, 2024
@SleepySquash SleepySquash modified the milestones: 0.2.0, 0.3.0 Sep 3, 2024
@SleepySquash SleepySquash modified the milestones: 0.2.1, 0.3.0 Sep 12, 2024
@SleepySquash SleepySquash modified the milestones: 0.2.2, 0.3.0 Oct 31, 2024
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
2 participants