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

TaskQueue<Success> async execution is not serial #3556

Closed
MuniekMg opened this issue Mar 7, 2024 · 3 comments
Closed

TaskQueue<Success> async execution is not serial #3556

MuniekMg opened this issue Mar 7, 2024 · 3 comments
Labels
contribution Community contribution PRs core Amplify Core components improvement Code quality, testing, etc.

Comments

@MuniekMg
Copy link
Contributor

MuniekMg commented Mar 7, 2024

Describe the bug

While working on other PR I found out that one unit test sometimes fails. This test expected correct order of function executions.

TaskQueue has async(...) function which should schedule task and execute this task in serial manner but it doesn't.

Steps To Reproduce

1. Add 1000 task to TaskQueue<Void>.async { print(i) }
2. Tasks won't be executed in order

Expected behavior

Tasks are being executed in order

Amplify Framework Version

2.27.0

Amplify Categories

DataStore

Dependency manager

Swift PM

Swift version

5

CLI version

10.3.1

Xcode version

Version 15.2 (15C500b)

Relevant log output

No response

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

iOS 17

Device

iPad 10th gen

Specific to simulators

No response

Additional context

No response

MuniekMg added a commit to MuniekMg/amplify-swift that referenced this issue Mar 7, 2024
@5d 5d added core Amplify Core components contribution Community contribution PRs labels Mar 7, 2024
@5d
Copy link
Member

5d commented Mar 8, 2024

Hi @MuniekMg ,

Thanks for reporting the issue and submitting the proposed PR. Our team will investigate and review the PR.

@thisisabhash thisisabhash added the bug Something isn't working label Mar 12, 2024
@ruisebas ruisebas added improvement Code quality, testing, etc. and removed bug Something isn't working labels Apr 9, 2024
5d added a commit that referenced this issue Apr 16, 2024
* fix(Core): TaskQueue<Success> async execution is not serial #3556 (#3557)

* fix(Core): make TaskQueue take async task throwable

* fix(core): resolve swift lint warnings

---------

Co-authored-by: Tomasz Trela <t.trela91@gmail.com>
@5d
Copy link
Member

5d commented Apr 18, 2024

The PR has been released in version 2.29.2. We are grateful for your valuable contribution.

@5d 5d closed this as completed Apr 18, 2024
Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Community contribution PRs core Amplify Core components improvement Code quality, testing, etc.
Projects
None yet
Development

No branches or pull requests

4 participants