-
Notifications
You must be signed in to change notification settings - Fork 159
EMT-2274 -- Remove AsyncTask and BranchPostTask Implementations #1287
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
Conversation
… thread safety - Eliminate BranchAsyncTask and related asynchronous task implementations across multiple classes - Replace AsyncTask calls with direct network calls to improve thread safety and simplify code - Update comments to reflect the modernized approach to handling network requests - This change is part of the ongoing effort to streamline the Branch SDK and enhance performance
ReferenceEMT-2274 -- Remove AsyncTask and BranchPostTask Implementations. Description🔄 What ChangedThis Pull Request undertakes a significant modernization effort by removing legacy 🔍 Impact of the ChangeThis is a high-impact architectural change. It significantly improves the SDK's performance by eliminating UI-blocking 📁 Total Files Changed30 files changed.
🧪 Test AddedExtensive new Kotlin unit and integration tests have been added to validate the new architecture and ensure backward compatibility.
🔒 Security VulnerabilitiesThe removal of Testing InstructionsTo test this PR, perform the following steps:
Risk Assessment [
|
|
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
Reference
EMT-2274 -- Remove AsyncTask and BranchPostTask Implementations
Description
This PR completes the modernization of the Branch Android SDK by removing all legacy
AsyncTaskandBranchPostTaskimplementations, replacing them with direct network calls and modern coroutines-based processing. This addresses critical thread safety concerns and eliminates deprecated API usage.Problem Statement
The Branch Android SDK contained multiple legacy
AsyncTaskandBranchPostTaskimplementations that posed significant risks:Solution
Replaced all AsyncTask patterns with direct, synchronous calls that are:
Files Modified
Core SDK Files
Branch.java
GetShortLinkTaskinner class extending AsyncTask.execute().get()patternbranchRemoteInterface_.make_restful_post()ServerRequestQueue.java
BranchPostTaskinner class (120+ lines)executeTimedBranchPostTask()andawaitTimedBranchPostTask()methodsDeviceInfo.java
processNextQueueItemcalls related to user agent fetchingBranchIntegrationModel.java
getDeepLinkSchemeTasksinner class extending BranchAsyncTaskexecuteTask().get()pattern with timeout handlingBranchUtil.getDeepLinkSchemes(context)UniversalResourceAnalyser.java
UrlSkipListUpdateTaskinner class extending BranchAsyncTaskexecuteTask()pattern with manual post-execute handlingupdateSkipURLFormatsDirectly(context)Test Files
URLContentViewerinner class extending BranchAsyncTaskexecute().get()pattern with exception handlingfetchURLContent()methodUtility Files
Impact Summary
Migration Pattern
Before: AsyncTask Pattern
After: Direct Pattern
Benefits Achieved
Breaking Changes
None - This is a pure refactoring with no breaking changes to public APIs.
Testing Instructions
Unit Testing
Integration Testing
Performance Testing
Regression Testing
Manual Testing Steps
Risk Assessment
MEDIUMRisk Factors
Mitigation Strategies
Validation Results
✅ Build Status: Successful compilation with no errors
✅ Dependencies: All imports and references properly cleaned up
✅ API Compatibility: No breaking changes to public interfaces
✅ Functional Validation: All network operations working correctly
✅ Performance Validation: Improved response times and memory usage
I, the PR creator, have tested — integration, unit, or otherwise — this code.
Reviewer Checklist (To be checked off by the reviewer only)
cc @BranchMetrics/saas-sdk-devs for visibility.