Skip to content

WMSDK-435: Fix pending callbacks#160

Merged
enotniy merged 1 commit into
developfrom
feature/WMSDK-435
Jun 9, 2025
Merged

WMSDK-435: Fix pending callbacks#160
enotniy merged 1 commit into
developfrom
feature/WMSDK-435

Conversation

@enotniy

@enotniy enotniy commented Jun 5, 2025

Copy link
Copy Markdown
Collaborator

@enotniy enotniy requested review from Copilot and sergeysozinov June 5, 2025 10:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes pending callback issues by introducing an asynchronous initialization flow using _initFuture.

  • Introduces _initFuture to serialize initialization and callback execution.
  • Copies pending callbacks and operations to safely iterate during processing.
  • Ensures that various getter methods wait for initialization to complete before invoking platform methods.
Comments suppressed due to low confidence (2)

mindbox_platform_interface/lib/src/types/mindbox_method_handler.dart:117

  • [nitpick] Consider standardizing the null handling behavior for platform channel calls. For example, the getToken method uses a null-coalescing operator while getDeviceUUID does not. If a consistent behavior is desired, align these implementations.
void getDeviceUUID({required Function(String uuid) callback}) async {

mindbox_platform_interface/lib/src/types/mindbox_method_handler.dart:171

  • [nitpick] Consider using the negation operator (!custom) for clarity and to align with common coding practices.
if (custom == false && (_inAppClickHandler != null || _inAppDismissedHandler != null)) {

@mindbox-cloud mindbox-cloud deleted a comment from github-actions Bot Jun 5, 2025
}

for (final callbackMethod in _pendingCallbackMethods) {
final pendingCallbackMethodsCopy =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А зачем нам этот код, если методы сработают только после инициализации? Т.е. списки будут пустыми

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

на всякий случай.

@enotniy enotniy merged commit ca9ed47 into develop Jun 9, 2025
11 of 12 checks passed
@enotniy enotniy deleted the feature/WMSDK-435 branch June 9, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants