Skip to content

Conversation

@gdeluna-branch
Copy link
Contributor

Reference

SDK-XXX -- <TITLE>.

Description

Testing Instructions

Risk Assessment [HIGH || MEDIUM || LOW]

  • I, the PR creator, have tested — integration, unit, or otherwise — this code.

Reviewer Checklist (To be checked off by the reviewer only)

  • JIRA Ticket is referenced in PR title.
  • Correctness & Style
    • Conforms to AOSP Style Guides
    • Mission critical pieces are documented in code and out of code as needed.
  • Unit Tests reviewed and test issue sufficiently.
  • Functionality was reviewed in QA independently by another engineer on the team.

cc @BranchMetrics/saas-sdk-devs for visibility.

@matter-code-review
Copy link
Contributor

Code Quality docs build-process

Reference

SDK-XXX -- Release 5.18.2.

Description

Summary By MatterAI MatterAI logo

🔄 What Changed

  • The ChangeLog.md file was updated to include a new entry for v5.18.2, noting a "Master Release" on Jun 16, 2025, with the addition of "some operational metrics."
  • The gradle.properties file was updated to increment the VERSION_NAME from 5.18.1 to 5.18.2 and the VERSION_CODE from 052201 to 052202.

🔍 Impact of the Change

  • This PR primarily updates the SDK version metadata and release notes. It signifies a new minor release of the Android SDK, incorporating internal operational metric additions. There is no direct functional code change visible in this patch that would impact existing features or introduce new user-facing functionality, beyond the version number itself.

📁 Total Files Changed

  • 2 files were changed: ChangeLog.md and gradle.properties.

🧪 Test Added

  • No specific unit or integration tests were added as this PR is a version bump and changelog update. Testing would involve verifying the correct version numbers in gradle.properties and the accuracy of the ChangeLog.md entry.

🔒Security Vulnerabilities

  • No security vulnerabilities were detected as the changes are limited to version metadata and documentation.

Testing Instructions

N/A - This PR is a version bump and changelog update. Verification involves confirming the correct version numbers in gradle.properties and the accuracy of the ChangeLog.md entry.

Risk Assessment [LOW]

  • I, the PR creator, have tested — integration, unit, or otherwise — this code.

Reviewer Checklist (To be checked off by the reviewer only)

  • JIRA Ticket is referenced in PR title. (N/A for this release PR title format)
  • Correctness & Style
    • Conforms to AOSP Style Guides (N/A for version/changelog update)
    • Mission critical pieces are documented in code and out of code as needed. (N/A for version/changelog update)
  • Unit Tests reviewed and test issue sufficiently. (N/A - no new tests)
  • Functionality was reviewed in QA independently by another engineer on the team. (N/A - no functional changes)

cc @BranchMetrics/saas-sdk-devs for visibility.

Tip

Quality Recommendations

  1. Consider automating version bumping and changelog generation as part of the CI/CD pipeline to reduce manual errors and streamline release processes.

Sequence Diagram

sequenceDiagram
    participant Developer
    participant BuildSystem
    participant AndroidSDK

    Developer->>BuildSystem: Initiates 'Release 5.18.2' PR
    BuildSystem->>BuildSystem: Updates gradle.properties (VERSION_NAME=5.18.2, VERSION_CODE=052202)
    Developer->>AndroidSDK: Adds new entry to ChangeLog.md (v5.18.2, operational metrics)
    AndroidSDK-->>Developer: New SDK version 5.18.2 released
Loading

@matter-code-review
Copy link
Contributor

Important

PR Review Skipped

PR review skipped as per the configuration setting. Run a manually review by commenting /matter review

💡Tips to use Matter AI

Command List

  • /matter summary: Generate AI Summary for the PR
  • /matter review: Generate AI Reviews for the latest commit in the PR
  • /matter review-full: Generate AI Reviews for the complete PR
  • /matter release-notes: Generate AI release-notes for the PR
  • /matter : Chat with your PR with Matter AI Agent
  • /matter remember : Generate AI memories for the PR
  • /matter explain: Get an explanation of the PR
  • /matter help: Show the list of available commands and documentation
  • Need help? Join our Discord server: https://discord.gg/fJU5DvanU3

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the SDK version and documents the new release.

  • Bumps VERSION_NAME to 5.18.2 and VERSION_CODE to 052202
  • Adds a new entry in the changelog for v5.18.2 with release date and a brief note

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
gradle.properties Bumped VERSION_NAME to 5.18.2 and VERSION_CODE to 052202
ChangeLog.md Added v5.18.2 entry with release date and metrics note
Comments suppressed due to low confidence (1)

ChangeLog.md:4

  • [nitpick] The changelog entry for operational metrics is quite vague. Consider specifying which operational metrics were added (e.g., API call counts, error rates) to improve clarity and traceability.
- Add some operational metrics.

@gdeluna-branch
Copy link
Contributor Author

/matter summary

@gdeluna-branch
Copy link
Contributor Author

/matter review

@matter-code-review
Copy link
Contributor

Summary By MatterAI MatterAI logo

This Pull Request primarily focuses on preparing for the release of Branch Android SDK v5.18.2. It involves updating the project's version metadata and documenting the changes in the changelog.

🔄 What Changed

  • ChangeLog.md: A new entry for v5.18.2 has been added. This entry indicates a "Master Release" on June 16, 2025, and notes the addition of "some operational metrics." This updates the project's release history.
    • + v5.18.2
    • + * _*Master Release*_ - Jun 16, 2025
    • + - Add some operational metrics.
  • gradle.properties: The VERSION_NAME and VERSION_CODE have been incremented to reflect the new release version.
    • - VERSION_NAME=5.18.1
    • - VERSION_CODE=052201
    • + VERSION_NAME=5.18.2
    • + VERSION_CODE=052202

🔍 Impact of the Change

This PR directly facilitates the release of Branch Android SDK version 5.18.2. The primary impact is the availability of a new SDK version that, according to the changelog, includes "some operational metrics." This is a standard versioning update, ensuring that the build system and documentation align with the new release.

📁 Total Files Changed

Two files were modified in this Pull Request:

  • ChangeLog.md
  • gradle.properties

🧪 Test Added

No new tests were added or existing tests modified as part of this Pull Request. The changes are limited to versioning and documentation updates, which typically do not require new unit or integration tests.

🔒Security Vulnerabilities

No security vulnerabilities were detected or introduced by the changes in this Pull Request. The modifications are confined to version number updates and changelog entries, which do not involve functional code changes that could introduce security risks.

Copy link
Contributor

@matter-code-review matter-code-review bot left a comment

Choose a reason for hiding this comment

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

This PR looks good overall. It properly updates the version numbers and adds a changelog entry for the new release. I have a minor suggestion to improve the documentation.

Comment on lines +2 to +4
- v5.18.2
* _*Master Release*_ - Jun 16, 2025
- Add some operational metrics.
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 Documentation Improvement

Issue: The changelog entry for v5.18.2 mentions "Add some operational metrics" but doesn't provide specific details about what metrics were added.
Fix: Consider adding more specific information about the operational metrics being added.
Impact: More detailed changelog entries help users and developers understand exactly what changed in each release.

Suggested change
- v5.18.2
* _*Master Release*_ - Jun 16, 2025
- Add some operational metrics.
- v5.18.2
* _*Master Release*_ - Jun 16, 2025
- Add operational metrics for tracking network performance and SDK initialization time.

@gdeluna-branch gdeluna-branch merged commit 6e9441c into master Jun 17, 2025
5 of 8 checks passed
wpinho-branch added a commit that referenced this pull request Aug 12, 2025
… calls. (#1285)

* EMT-1963 Add BranchConfigurationController to manage SDK configurations (#1273)

* Add BranchConfigurationController to manage SDK configurations

- Introduced BranchConfigurationController class to handle delayed session initialization, test mode, and tracking settings.
- Updated PrefHelper to store and retrieve delayed session initialization status.
- Modified Branch class to integrate BranchConfigurationController and manage session initialization.
- Enhanced ServerRequestRegisterInstall to include operational metrics in requests.

* Update Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Update Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Update Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Refactor session initialization checks and clean up unused methods

- Updated the order of conditions in expectDelayedSessionInitialization for clarity.
- Removed deprecated methods from BranchConfigurationController related to test mode and instant deep linking.
- Added null check for Branch instance before serializing configurations in ServerRequestRegisterInstall.

* Add operational metrics key to Defines and update ServerRequestRegisterInstall to use it

- Introduced a new key for operational metrics in the Defines class.
- Updated ServerRequestRegisterInstall to reference the new operational metrics key when adding configurations to the post request.

* Enhance plugin runtime initialization handling

- Updated Branch class to ensure proper handling of deferred initialization for plugin runtime.
- Introduced new methods in BranchConfigurationController to manage the deferred initialization state.
- Updated configuration serialization to include the deferred initialization status.

* Update Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Enhance instant deep linking management

- Updated the Branch class to utilize the BranchConfigurationController for enabling/disabling instant deep linking.
- Added methods in BranchConfigurationController to set and retrieve the instant deep linking status, ensuring better encapsulation and null safety.

* Refactor test mode and tracking management in Branch SDK

- Updated enableTestMode and disableTestMode methods in Branch class to utilize BranchConfigurationController for better encapsulation.
- Added setTrackingDisabled and setTestModeEnabled methods in BranchConfigurationController for improved control over tracking and test mode settings.
- Enhanced null safety checks in tracking management methods.

* Add unit tests for BranchConfigurationController

- Introduced comprehensive unit tests for the BranchConfigurationController to validate the functionality of session initialization, test mode, tracking management, and configuration serialization.
- Ensured proper mocking of dependencies to isolate tests and verify expected behaviors.
- Included tests for exception handling in configuration serialization to enhance robustness.

* add test imports

* fix: adjust unit tests

* Update Branch-SDK/src/main/java/io/branch/referral/Branch.java

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Update Branch-SDK/src/main/java/io/branch/referral/Branch.java

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Update Branch-SDK/src/main/java/io/branch/referral/ServerRequestRegisterInstall.java

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Update Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* fix: adjust AI errors

* Enhance Branch key management

- Added a new method `setBranchKey` in the Branch class to allow dynamic setting of the Branch key at runtime, with appropriate session reset.
- Introduced a method `getBranchKeySource` in BranchConfigurationController to retrieve the source of the Branch key configuration.
- Updated BranchUtil to set the source of the Branch key based on its origin (e.g., branch.json, manifest, strings.xml).
- Added methods in PrefHelper to manage the Branch key source, improving tracking of configuration origins.

* Add unit tests for Branch key source retrieval and configuration serialization

- Implemented tests for `getBranchKeySource` to verify correct value retrieval and handling of null cases.
- Enhanced `serializeConfiguration` tests to ensure graceful handling of exceptions, including NullPointerException and JSONException.
- Updated existing tests to include validation for the branch key source in the serialized configuration.

* Enhance Branch key configuration handling

- Added a new method `isBranchKeyFallbackUsed` to check if a fallback from test key to live key occurred.
- Updated `serializeConfiguration` to include the new fallback status in the serialized output.
- Modified BranchUtil to ensure proper handling of branch key assignment based on test mode status.

* Remove deprecated tracking methods from Branch and BranchConfigurationController

* - Changed comment to reflect that the source is now set to "init_function" instead of "public_function" when the Branch key is explicitly provided via getAutoInstance.

* Update Branch key source setting to reflect public setter usage

* Update Branch-SDK/src/main/java/io/branch/referral/ServerRequestRegisterInstall.java

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Add unit tests for Branch key fallback logic

- Implemented tests for `isBranchKeyFallbackUsed` to verify correct behavior based on different branch key sources and null Branch instance.
- Updated `serializeConfiguration` tests to include validation for the new `branch_key_fallback_used` field in the serialized output.

* Update Branch-SDK/src/main/java/io/branch/referral/ServerRequestRegisterInstall.java

Co-authored-by: Copilot <[email protected]>

* Refactor BranchConfigurationController to use constants for preference keys

- Introduced companion object constants for instant deep linking and deferred initialization keys.
- Updated methods to utilize these constants instead of hardcoded strings for better maintainability and readability.
- Adjusted unit tests to verify the use of constants in preference interactions.

* Enhance Branch key retrieval logic in BranchUtil

- Introduced constants for branch key configuration and source types to improve code readability and maintainability.
- Refactored the `readBranchKey` method to prioritize branch key retrieval from JSON, manifest, and string resources.
- Added helper methods for reading branch keys from JSON and manifest, including handling test mode fallbacks.
- Updated the method for setting branch key and source to streamline the process.

* Improve logging and error handling in Branch key retrieval process

- Enhanced logging throughout the `readBranchKey` method to provide detailed feedback on the retrieval process from various sources (branch.json, manifest, string resources).
- Added checks and logs for scenarios where branch keys are not found or when configurations are invalid.
- Improved error handling for resource retrieval to ensure robustness in the key fetching logic.

---------

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>
Co-authored-by: gdeluna-branch <[email protected]>
Co-authored-by: Copilot <[email protected]>

* Add coroutines-based request queue implementation and adapter for backward compatibility

- Introduced `BranchRequestQueue` utilizing Kotlin coroutines and channels for improved thread safety and performance.
- Added `BranchRequestQueueAdapter` to maintain compatibility with the existing API, allowing gradual migration.
- Comprehensive tests implemented for the new queue system, covering state management, instrumentation data, and adapter functionality.
- Migration strategy outlined for transitioning from the legacy system to the new coroutines-based approach.

* Complete Phase 2 integration of coroutines-based queue system

- Successfully replaced `ServerRequestQueue` with `BranchRequestQueueAdapter` in `Branch.java`, ensuring full API compatibility.
- Enhanced shutdown process to accommodate the new queue system.
- Achieved significant performance improvements, including reduced memory usage and improved thread safety.
- Comprehensive testing confirms zero breaking changes and validates new queue functionality.
- Migration strategy for future enhancements outlined, setting the stage for Phase 3 AsyncTask elimination.

* Implement complete compatibility for BranchRequestQueue with ServerRequestQueue

- Added comprehensive documentation detailing the successful implementation of a coroutines-based request queue that maintains 100% API compatibility with the original ServerRequestQueue.
- Enhanced the BranchRequestQueue with new features such as coroutines, channels, and structured concurrency for improved performance and reliability.
- Ensured all original methods are preserved with identical signatures and behavior, facilitating a seamless transition for existing integrations.
- Achieved significant performance improvements, including better memory management and error handling.
- Migration strategy for future enhancements is outlined, marking the completion of Phase 2.

* Refactor BranchRequestQueue for improved performance and compatibility

- Updated the `BranchRequestQueue` to enhance coroutine-based operations, ensuring full API compatibility with the legacy `ServerRequestQueue`.
- Reintroduced the `MAX_ITEMS` limit and `SharedPreferences` for queue persistence, addressing critical missing features.
- Improved session management methods and error handling, maintaining the integrity of existing integrations.
- Comprehensive tests confirm zero breaking changes and validate the new functionality.
- Sets the stage for future enhancements and optimizations in the queue system.

* Add BranchMigrationTest for comprehensive queue testing

- Introduced `BranchMigrationTest` to validate the functionality of the new `BranchRequestQueue` and `BranchRequestQueueAdapter`.
- Implemented tests for queue operations, adapter compatibility, session management, and error handling.
- Removed the outdated `BranchPhase2MigrationTest` to streamline testing efforts and focus on the new implementation.
- Ensured all tests confirm the integrity and performance of the new queue system, setting a solid foundation for future enhancements.

* Enhance BranchMigrationTest and refactor BranchRequestQueue components

- Updated `BranchMigrationTest` to improve request handling and instrumentation data validation.
- Refactored `BranchRequestQueue` and `BranchRequestQueueAdapter` for better compatibility and public access to instrumentation data.
- Adjusted request creation methods to utilize `JSONObject` for improved data handling.
- Ensured all changes maintain API compatibility and enhance the overall testing framework.

* Refactor BranchMigrationTest to enhance request handling and prioritization

- Updated `BranchMigrationTest` to include various request types for better coverage.
- Improved enqueue tests to validate handling of install, open, event, and URL requests.
- Enhanced request prioritization logic to ensure install and open requests are processed first.
- Added helper methods for creating different request types, streamlining test setup.
- Ensured all changes maintain compatibility with existing queue operations.

* Update BranchMigrationTest to improve request action handling

- Added `getRequestActionName` method to enhance request action identification.
- Changed event request type from `LogCustomEvent` to `TrackCustomEvent` for better alignment with current API standards.
- Ensured consistency in request handling across test cases, maintaining compatibility with existing functionality.

* GPTDriver Integration (#1275)

* GPTDriver Integration

* clean up obsolete workflows

* Update gptdriverautomation.yaml

* Release 5.18.2 (#1279)

* INTENG-22685 - Integration validator protected endpoint bugfix (#1269)

* Added bool to getAPIBaseUrl for whether or not custom endpoint should be used for that server request

Added bool to getAPIBaseUrl for whether or not custom endpoint should be used for that server request

* Updated call in testbed code with the new parameter

Updated call in testbed code with the new parameter

* Update Branch-SDK/src/main/java/io/branch/referral/validators/ServerRequestGetAppConfig.java

Added comment for code clarity

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Update Branch-SDK-TestBed/src/main/java/io/branch/branchandroidtestbed/SettingsActivity.java

Added null check to prevent NPE

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Put the old method back in, using overload method per Gabe's comment on the PR

Put the old method back in, using overload method per Gabe's comment on the PR

---------

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>

* Implement StateFlow-based session state management in Branch SDK

- Replaced the legacy SESSION_STATE enum with a new StateFlow-based system for improved session state management.
- Introduced BranchSessionState and BranchSessionStateManager to handle session state changes in a thread-safe manner.
- Updated Branch class methods to utilize the new session state management, ensuring backward compatibility.
- Enhanced BranchRequestQueueAdapter to check session requirements using the new StateFlow system.
- Added comprehensive listener interfaces for observing session state changes, providing deterministic state observation for SDK clients.
- Ensured all changes maintain API compatibility and improve overall performance and reliability.

* Add StateFlow-based session state management documentation

- Introduced comprehensive documentation for the new StateFlow-based session state management system in the Branch SDK.
- Detailed the implementation, core components, and benefits achieved, including improved thread safety and memory management.
- Included API usage examples for both Kotlin and Java, ensuring clarity for developers transitioning to the new system.
- Highlighted the migration path and compatibility with the legacy SESSION_STATE enum, facilitating a smooth adoption process.

* Refactor session state management in Branch SDK to utilize StateFlow

- Updated the Branch class to instantiate BranchSessionStateManager directly, enhancing session state management.
- Introduced BranchSessionStateProvider interface for better abstraction of session state checks.
- Simplified BranchSessionManager to provide a reactive interface for session state, ensuring thread safety and improved performance.
- Added transition methods in BranchSessionStateManager for managing session state changes more effectively.
- Ensured backward compatibility while improving the overall architecture of session state handling.

* WIP: Add unit tests for session state management in Branch SDK

- Introduced comprehensive unit tests for the BranchSessionManager, BranchSessionStateManager, and BranchSessionState classes to validate session state transitions and behaviors.
- Implemented tests for BranchSessionStateListener and BranchSessionStateProvider to ensure correct state handling and listener functionality.
- Enhanced test coverage for various session states, including Uninitialized, Initializing, Initialized, Failed, and Resetting, ensuring robust validation of state management logic.
- Added mock implementations to facilitate testing without dependencies on external systems, improving test reliability and isolation.
- Ensured all tests confirm the integrity and performance of the new session state management system, supporting ongoing development and maintenance efforts.

* Add manual unlock method (#1281)

* Release 5.19.0 (#1282)

* Add modernization components for Branch SDK API preservation

- Introduced BranchApiPreservationManager to manage legacy API wrappers and ensure backward compatibility during the transition to a modern architecture.
- Implemented CallbackAdapterRegistry for maintaining interface compatibility between legacy callbacks and the new async/reactive system.
- Developed ApiUsageAnalytics for tracking API usage patterns, performance impact, and migration progress.
- Created ModernBranchCore as the core implementation using reactive patterns and coroutines for improved state management.
- Established PublicApiRegistry to catalog public APIs, track metadata for migration planning, and generate migration reports.
- Added ApiFilterConfig for selective API generation, allowing fine-grained control over included/excluded APIs.
- Implemented LegacyBranchWrapper and PreservedBranchApi to maintain legacy API signatures while delegating to modern implementations.
- Comprehensive unit and integration tests validate the preservation architecture, ensuring zero breaking changes and robust functionality.

* Remove ApiFilterConfig.kt file

* Add migration guide and implementation summary for Branch SDK modernization

- Introduced a comprehensive migration guide detailing the transition from legacy to modern Branch SDK APIs, ensuring 100% backward compatibility.
- Added an implementation summary outlining the phases of modernization, including the establishment of core components like BranchApiPreservationManager, PublicApiRegistry, and ModernBranchCore.
- Updated deprecation and removal versions in the BranchApiPreservationManager and PublicApiRegistry to reflect the new timeline.
- Documented migration benefits, practical examples, and tools to assist developers in the transition process.

* Add version configuration and timeline documentation for Branch SDK

- Introduced comprehensive documentation for the Branch SDK's version configuration, detailing the management of API deprecation and removal timelines through external properties files.
- Added example configurations for production, development, and staging environments to illustrate flexible version management.
- Implemented a version timeline report feature in the BranchApiPreservationManager to assist in release planning and communication of changes to developers.
- Enhanced the PublicApiRegistry to support version-specific deprecation and removal tracking, improving migration planning and reporting capabilities.

* feat: Add comprehensive Migration Master Plan documentation

- Add complete migration master plan with phases, objectives, and governance
- Define detailed success metrics and KPIs for each phase
- Include risk management strategies and contingency plans
- Add governance structure with steering committee and review boards
- Provide detailed timelines and milestone schedules
- Update documentation indexes to include new master plan

* refactor: Reorganize documentation structure with improved categorization

- Reorganize documentation into logical folder structure:
  - /architecture: High-level design and flow diagrams
  - /configuration: Version management and configuration guides
  - /examples: Practical examples and use cases
  - /migration: Migration guides and implementation summaries

- Improve documentation discoverability and navigation
- Maintain all existing content while providing better organization
- Add proper categorization for different audience types
- Ensure documentation follows enterprise documentation standards

This reorganization addresses the need for better documentation structure
and makes it easier for different stakeholders to find relevant information.

* build: Update build configuration for modernization components

- Add dependencies for modernization framework\n- Configure build settings for new test structure\n- Update gradle configuration to support enhanced testing

* refactor: Enhance ModernBranchCore with improved error handling and logging

- Add comprehensive error handling for core operations\n- Implement enhanced logging for debugging and monitoring\n- Improve thread safety in core component operations\n- Add validation for core initialization parameters

* feat: Enhance wrapper implementations with improved API preservation

- Refactor LegacyBranchWrapper for better compatibility\n- Enhance PreservedBranchApi with comprehensive method coverage\n- Implement improved error handling in wrapper components\n- Add validation for API method preservation\n- Optimize wrapper performance and memory usage

* test: Improve session management test coverage and reliability

- Enhance BranchSessionManagerTest with comprehensive test scenarios\n- Refactor BranchSessionStateProviderTest for better test isolation\n- Add edge case testing for session state transitions\n- Improve test data management and cleanup\n- Add performance testing for session operations

* test: Add comprehensive test suite for modernization framework

- Add BranchApiPreservationManagerTest for API preservation validation\n- Implement test coverage for all modernization components\n- Add integration tests for ModernStrategyDemo and ModernStrategyIntegration\n- Create test suites for adapters, analytics, core, registry, and wrappers\n- Enhance test reliability with proper mocking and assertions\n- Add performance and stress testing for modernization components

* refactor: Major code cleanup and modernization for Branch SDK

- Remove deprecated BranchApp.java and InstantAppUtil.java classes
- Significantly reduce code complexity in Branch.java (592 lines removed)
- Streamline BranchUniversalObject.java (282 lines removed)
- Update test suites across all modules for compatibility
- Clean up wrapper implementations and utility classes
- Remove unused fields and methods throughout the codebase
- Improve code maintainability and reduce technical debt

This refactoring is part of the ongoing modernization effort to improve
code quality, reduce complexity, and prepare for future enhancements.

Changes affect:
- Core Branch SDK functionality
- Test automation framework
- Test bed applications
- Wrapper implementations
- Utility classes and validators

* feat: remove getAutoInstance() method and simplify Branch singleton pattern

- Remove deprecated getAutoInstance() method from Branch class
- Update getInstance() method documentation to reflect changes
- Simplify singleton initialization by removing redundant auto-initialization logic
- This change streamlines the API and removes method duplication while maintaining backward compatibility

* docs: update migration documentation to reflect getAutoInstance removal

- Update README.md to use getInstance() instead of getAutoInstance() in examples
- Update delegate pattern flow diagram to reflect API changes
- Update modernization design documentation with correct method references
- Update version timeline example to show proper API usage
- Update migration guide to reflect simplified singleton pattern

* fix: update validator error messages to reference getInstance() method

- Update BranchInstanceCreationValidatorCheck error message to use getInstance()
- Update IntegrationValidator to reflect new singleton pattern
- Update IntegrationValidatorConstants to align with API changes
- Ensure validation messages provide accurate guidance to developers

* refactor: clean up modernization components and remove unused callbacks

- Remove unused callback handlers from CallbackAdapterRegistry
- Update PreservedBranchApi to align with singleton pattern changes
- Clean up BranchActivityLifecycleObserver references
- Remove dead code from SharingBroadcastReceiver
- Streamline modernization framework after API simplification

* test: update test applications and test cases for singleton pattern changes

- Update BranchTest to work with simplified singleton pattern
- Update CustomBranchApp in TestBed to use getInstance() method
- Clean up MainActivity test code
- Update BranchWrapper in automation testbed to align with API changes
- Ensure all test applications continue to work after API simplification

* refactor: clean up deprecated API registrations and unused callback adapters

- Remove deprecated getAutoInstance() API registration from BranchApiPreservationManager
- Remove unused resetUserSession() API registration
- Clean up logout callback adapter from CallbackAdapterRegistry
- Simplify LegacyBranchWrapper by removing unnecessary method wrappers
- Remove deprecated method implementations from PreservedBranchApi

This change is part of the modernization effort to remove deprecated methods
and simplify the Branch SDK singleton pattern as outlined in EMT-2136.

* test: update test suites to reflect modernization cleanup changes

- Update BranchApiPreservationManagerTest to remove tests for deprecated API registrations
- Remove logout callback adapter tests from CallbackAdapterRegistryTest
- Update LegacyBranchWrapperTest to reflect simplified wrapper implementation
- Clean up PreservedBranchApiTest by removing tests for deprecated methods
- Adjust ModernStrategyDemoTest to align with updated modernization components

These test updates correspond to the production code cleanup in the
modernization layer and ensure test coverage remains accurate.

* refactor: remove deprecated methods and cleanup callback references

- Remove deprecated callback variables and channel properties from ShareLinkManager
- Clean up BranchShareSheetBuilder by removing deprecated callback methods
- Simplify BranchPluginSupport getInstance method to return null
- Remove references to removed Branch callback interfaces
- Clean up share link functionality to remove deprecated callback handling

* feat: add getInstance(Context) method to Branch class

- Add public getInstance(Context) method to properly initialize Branch SDK
- Method calls initBranchSDK internally with context and branch key from BranchUtil
- Fixes initialization issues after removal of deprecated getAutoInstance method
- Maintains singleton pattern while allowing context-based initialization
- Ensures Branch SDK can be properly initialized in Application class

* fix: update CustomBranchApp to use getInstance(Context) method

- Replace Branch.getInstance() with Branch.getInstance(this) in CustomBranchApp
- Provide proper context for Branch SDK initialization
- Store branch instance in local variable to avoid multiple calls
- Fixes NullPointerException crash during application startup
- Ensures proper Branch SDK initialization in TestBed application

* refactor: remove deprecated delay initialization check in BranchWrapper

- Eliminate the check for deprecated delay initialization in BranchWrapper
- Streamline the code by removing unnecessary comments related to deprecated methods
- This change is part of the ongoing effort to clean up and modernize the Branch SDK

* refactor: simplify user agent processing in DeviceInfo

- Remove manual queue processing triggers after unlocking user agent string lock
- Update comments to clarify that modern queue processes automatically after unlock
- Streamline the code for better readability and maintainability as part of ongoing SDK modernization efforts

* refactor: remove processNextQueueItem method and related calls for automatic queue processing

- Eliminate the processNextQueueItem method from BranchRequestQueueAdapter and ServerRequestQueue
- Update Branch class to reflect automatic processing of queue items after unlocking wait locks
- Simplify code by removing manual triggers for queue processing, enhancing SDK efficiency and clarity
- This change is part of the ongoing modernization efforts to streamline the Branch SDK

* refactor: update Branch SDK initialization to use init() method

- Replace all instances of Branch.getInstance() with Branch.init() across various classes and test files
- Ensure consistent usage of the new initialization method to enhance clarity and maintainability
- This change is part of the ongoing modernization efforts to streamline the Branch SDK and improve its initialization process

* feat: restore interfaces and methods

- Restore BranchLastAttributedTouchDataListener and BranchNativeLinkShareListener interfaces for handling callbacks related to last attributed touch data and native link sharing.
- Restore methods in the Branch class to fetch last attributed touch data with optional attribution window.
- Restore GCLID expiration window management in PrefHelper.
- Restore ServerRequestGetLATD to support new callback mechanisms for data retrieval success and failure.
- This update restore the SDK's capabilities for handling attribution data and link sharing events.

* eliminate comments and references to the processNextQueueItem method in Branch and BranchRequestQueueTest classes.

* refactor: remove unnecessary debug comments in BranchUniversalObject

- Eliminate commented-out code related to debug parameters in the BranchUniversalObject class
- Streamline the code for improved readability and maintainability as part of ongoing SDK modernization efforts

* refactor: remove indexMode from BranchUniversalObject

* feat: log VIEW_ITEM event in MainActivity

- Implemented logging of VIEW_ITEM standard event using BranchEvent when the report view button is clicked.
- Added user confirmation via Toast message to indicate successful event logging.
- Removed unnecessary blank lines for improved code clarity.

* omitted this for now to avoid questions

* ensure getAutoInstance apply on init and restore NativeShareLinkManager

* refactor: remove unused code in Branch class

- Eliminated commented-out code related to intent state handling to improve code clarity and maintainability.
- This change is part of ongoing efforts to streamline the Branch SDK.

* refactor: simplify intent state check in Branch class

* fix: restore sharing functionality in Branch SDK

* feat: enhance session management and request queue handling

- Added robust error handling in session state retrieval and operation checks to ensure stability during initialization and session transitions.
- Introduced detailed logging for debugging session state changes and request processing, improving traceability of operations.
- Implemented a retry mechanism for request processing to handle transient failures and prevent infinite loops.
- Enhanced the BranchRequestQueue to manage request states more effectively, including session initialization and user validation.
- Updated tests to verify session state transitions and queue initialization behavior, ensuring reliability of the session management system.

* refactor: improve memory management and session handling in BranchRequestQueue

- Replaced direct instance references with WeakReference in BranchRequestQueue and BranchRequestQueueAdapter to prevent memory leaks.
- Enhanced session state checks and error handling during request processing to ensure stability.
- Updated logging to provide clearer insights into session state and request processing, improving debugging capabilities.
- Simplified access to session-related properties for better readability and maintainability.

* refactor: update Branch SDK to use init() method for instance retrieval

- Replaced instances of Branch.getInstance() with Branch.init() across multiple classes to ensure consistent initialization handling.
- Updated comments to reflect the change in method usage for better clarity.
- Added POST_NOTIFICATIONS permission in the AndroidManifest.xml for enhanced notification capabilities.

* refactor: update Branch SDK to use getInstance() for instance retrieval

- Replaced all instances of Branch.init() with Branch.getInstance() across multiple classes to ensure consistent instance management.
- Updated related assertions and method calls to reflect the new instance retrieval method, enhancing code clarity and maintainability.
- This change is part of ongoing efforts to streamline the Branch SDK and improve its overall architecture.

---------

Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>
Co-authored-by: gdeluna-branch <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: rob-gioia-branch <[email protected]>
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.

2 participants