Skip to content

Conversation

@dogi
Copy link
Member

@dogi dogi commented Nov 10, 2025

Refactored uploadExamResult, uploadFeedback, uploadAchievement, and uploadResourceActivities in UploadManager to be suspend functions. This moves the blocking database, serialization, and network operations to a background thread, resolving the ANR.

Updated the call sites in AutoSyncWorker to launch these functions within a coroutine on the applicationScope.

Also restored error handling to uploadExamResult that was removed in a previous refactoring.


https://jules.google.com/session/15369501537486835428

Refactored `uploadExamResult`, `uploadFeedback`, `uploadAchievement`, and `uploadResourceActivities` in `UploadManager` to be `suspend` functions. This moves the blocking database, serialization, and network operations to a background thread, resolving the ANR.

Updated the call sites in `AutoSyncWorker` to launch these functions within a coroutine on the `applicationScope`.

Also restored error handling to `uploadExamResult` that was removed in a previous refactoring.
Refactored `uploadExamResult`, `uploadFeedback`, `uploadAchievement`, and `uploadResourceActivities` in `UploadManager` to be `suspend` functions. This moves the blocking database, serialization, and network operations to a background thread, resolving the ANR.

Updated the call sites in `AutoSyncWorker`, `UserInformationFragment`, `ServerReachabilityWorker`, and `ProcessUserDataActivity` to launch these functions within a coroutine on an appropriate scope. This resolves the compilation errors introduced by the refactoring.

Also restored error handling to `uploadExamResult` that was removed in a previous refactoring.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +222 to +223
val asyncOperationsCounter = AtomicInteger(0)
val totalAsyncOperations = 6

Choose a reason for hiding this comment

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

P1 Badge Correct async upload counter after refactor

After uploadExamResult() and uploadFeedback() were converted to suspending functions and invoked before the counter, only five callbacks now call checkAllOperationsComplete(), but totalAsyncOperations remains 6. This means the atomic counter never reaches the expected value and the progress dialog is never dismissed after the remaining uploads finish.

Useful? React with 👍 / 👎.

@dogi dogi added triage Further information is requested experiment close? labels Nov 10, 2025
@dogi dogi closed this Nov 10, 2025
@dogi dogi reopened this Nov 10, 2025
@dogi dogi removed the close? label Nov 10, 2025
@Okuro3499 Okuro3499 added the duplicate This issue or pull request already exists label Nov 10, 2025
@dogi
Copy link
Member Author

dogi commented Nov 10, 2025

@Okuro3499 my branch got created on saturday
your got pushed while I was merging stuff

@dogi dogi closed this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists experiment triage Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants